/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * com_distri_clasif_viajes_detalle.java
 *
 * Created on 8/06/2011, 09:56:30 AM
 */
package sie_invdis;

import java.awt.print.PrinterException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.text.*;
import java.text.ParseException;

import javax.swing.SwingConstants;

import javax.swing.table.DefaultTableCellRenderer;

import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;

import java.io.*;
/**
 *
 * @author Michelle
 */
public class com_distri_clasif_viajes_detalle extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_proveedorestadistica;
    private javax.swing.table.DefaultTableModel jtable_modelo_compras;
    private javax.swing.table.DefaultTableModel jtable_modelo_distribucion;
    private javax.swing.table.DefaultTableModel jtable_modelo_distribucion_resum;
    private javax.swing.table.DefaultTableModel jtable_modelo_comprasxfamilia;
    private javax.swing.table.DefaultTableModel jtable_modelo_comprasxfam_detprov;
    private javax.swing.table.DefaultTableModel jtable_modelo_comxfam_detpro_artis;
    private javax.swing.table.DefaultTableModel jtable_modelo_exisentienda;
    private javax.swing.table.DefaultTableModel jtable_modelo_ventayexistencia;
    private javax.swing.table.DefaultTableModel jtable_modelo_rec;
    private javax.swing.table.DefaultTableModel jtable_modelo_sie;

    private DefaultListModel modelo ;

    DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;
    private int buscamp=1,opbuscamp=1,control_enter=0,indexactual=0,yacargueestadistica=0,yacargueviajedistri=0,columnavisualisa=2,yacarguefamrot=0,yacargueexitie=0,yacarguevenacum=0,ld=0;

    private bd_conexion x = new bd_conexion();
    //se creaa la variable resultset
    private ResultSet rs = null;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");

    /** Creates new form com_distri_clasif_viajes_detalle */
    public com_distri_clasif_viajes_detalle() {
        initComponents();
    }

    public com_distri_clasif_viajes_detalle(String fviaje,String describeviaje) {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_resumenxsubfamilia();
        this.iniciar_modelo_compras();
        this.iniciar_modelo_distribucionalma();
        this.iniciar_modelo_comprasxfamilia();
        this.iniciar_modelo_comprasxfam_detxprov();
        this.iniciar_modelo_comprasxfam_detxprov_arti();
        this.iniciar_modelo_existenciaentienda();
        this.iniciar_modelo_distribucion_resumen();
        this.iniciar_modelo_recpeciones();
        this.iniciar_modelo_artresumen();
        initComponents();
        this.jtf_idviaje.setText(fviaje);
        this.jtf_viajedescribe.setText(describeviaje);

        this.setTitle("Detalle Viaje:"+describeviaje);
        jtb_catalogo_articulos.getColumnModel().getColumn(0).setPreferredWidth(5);//id
        jtb_catalogo_articulos.getColumnModel().getColumn(1).setPreferredWidth(15);//Viaje
        jtb_catalogo_articulos.getColumnModel().getColumn(2).setPreferredWidth(15);//fam
        jtb_catalogo_articulos.getColumnModel().getColumn(3).setPreferredWidth(60);//proveedor
        jtb_catalogo_articulos.getColumnModel().getColumn(4).setPreferredWidth(10);//id
        jtb_catalogo_articulos.getColumnModel().getColumn(5).setPreferredWidth(65);//codigo
        jtb_catalogo_articulos.getColumnModel().getColumn(6).setPreferredWidth(120);//descripcion
        jtb_catalogo_articulos.getColumnModel().getColumn(7).setPreferredWidth(60);//Item.
        jtb_catalogo_articulos.getColumnModel().getColumn(8).setPreferredWidth(60);//Item
        jtb_catalogo_articulos.getColumnModel().getColumn(9).setPreferredWidth(10);//cant
        jtb_catalogo_articulos.getColumnModel().getColumn(10).setPreferredWidth(10);//costo
        jtb_catalogo_articulos.getColumnModel().getColumn(11).setPreferredWidth(10);//costos
        jtb_catalogo_articulos.getColumnModel().getColumn(12).setPreferredWidth(10);//precio
        jtb_catalogo_articulos.getColumnModel().getColumn(13).setPreferredWidth(10);//precio m
       
        jtb_comprascatalogo.getColumnModel().getColumn(0).setPreferredWidth(60);//Status
        jtb_comprascatalogo.getColumnModel().getColumn(1).setPreferredWidth(20);//Folio
        jtb_comprascatalogo.getColumnModel().getColumn(2).setPreferredWidth(35);//doc referencia
        jtb_comprascatalogo.getColumnModel().getColumn(3).setPreferredWidth(35);//fecha docto
        jtb_comprascatalogo.getColumnModel().getColumn(4).setPreferredWidth(35);//fecha llega almacen
        jtb_comprascatalogo.getColumnModel().getColumn(5).setPreferredWidth(35);//f.recepcion
        jtb_comprascatalogo.getColumnModel().getColumn(6).setPreferredWidth(35);//dias trans
        jtb_comprascatalogo.getColumnModel().getColumn(7).setPreferredWidth(60);//viaje
        jtb_comprascatalogo.getColumnModel().getColumn(8).setPreferredWidth(120);//proveedor
        jtb_comprascatalogo.getColumnModel().getColumn(9).setPreferredWidth(35);//piezas
        jtb_comprascatalogo.getColumnModel().getColumn(10).setPreferredWidth(35);//costo
        jtb_comprascatalogo.getColumnModel().getColumn(11).setPreferredWidth(35);//costo
        jtb_comprascatalogo.getColumnModel().getColumn(12).setPreferredWidth(35);//precio
        jtb_comprascatalogo.getColumnModel().getColumn(13).setPreferredWidth(120);//observaciones

        jtbl_recepciones.getColumnModel().getColumn(0).setPreferredWidth(10);//Status
        jtbl_recepciones.getColumnModel().getColumn(1).setPreferredWidth(20);//Folio
        jtbl_recepciones.getColumnModel().getColumn(2).setPreferredWidth(60);//doc referencia
        jtbl_recepciones.getColumnModel().getColumn(3).setPreferredWidth(15);//fecha docto
        jtbl_recepciones.getColumnModel().getColumn(4).setPreferredWidth(35);//fecha llega almacen
        jtbl_recepciones.getColumnModel().getColumn(5).setPreferredWidth(35);//f.recepcion
        jtbl_recepciones.getColumnModel().getColumn(6).setPreferredWidth(35);//dias trans
        jtbl_recepciones.getColumnModel().getColumn(7).setPreferredWidth(5);//viaje
        jtbl_recepciones.getColumnModel().getColumn(8).setPreferredWidth(60);//proveedor
        jtbl_recepciones.getColumnModel().getColumn(9).setPreferredWidth(10);//proveedor
        jtbl_recepciones.getColumnModel().getColumn(10).setPreferredWidth(20);//proveedor
        jtbl_recepciones.getColumnModel().getColumn(10).setPreferredWidth(20);//proveedor


    jtb_catalogo_articulos1.getColumnModel().getColumn(0).setPreferredWidth(40);//tem ent
    jtb_catalogo_articulos1.getColumnModel().getColumn(1).setPreferredWidth(40);//Familia
    jtb_catalogo_articulos1.getColumnModel().getColumn(2).setPreferredWidth(50);//Subfamilia
    jtb_catalogo_articulos1.getColumnModel().getColumn(3).setPreferredWidth(90);//Clave
    jtb_catalogo_articulos1.getColumnModel().getColumn(4).setPreferredWidth(140);//Descripcion
    jtb_catalogo_articulos1.getColumnModel().getColumn(5).setPreferredWidth(60);//item
    jtb_catalogo_articulos1.getColumnModel().getColumn(6).setPreferredWidth(60);//Linea
    jtb_catalogo_articulos1.getColumnModel().getColumn(7).setPreferredWidth(20);//Precio
    jtb_catalogo_articulos1.getColumnModel().getColumn(8).setPreferredWidth(60);//Fecha
    jtb_catalogo_articulos1.getColumnModel().getColumn(9).setPreferredWidth(40);//Acum
    jtb_catalogo_articulos1.getColumnModel().getColumn(10).setPreferredWidth(20);//Exist
    jtb_catalogo_articulos1.getColumnModel().getColumn(11).setPreferredWidth(20);//% Rotacion

        this.carga_datos(9, fviaje);
        this.cargar_datos_clasificacion(1, 0, fviaje);

    this.loadcombo();
    }

private void iniciar_modelo_compras() {
        jtable_modelo_compras = new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_compras.addColumn("<html><b>Status</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Folio</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Doc. Ref.</b></html>");
        jtable_modelo_compras.addColumn("<html><b>F.llega alm</b></html>");
        jtable_modelo_compras.addColumn("<html><b>F.Ref</b></html>");
        jtable_modelo_compras.addColumn("<html><b>F.Recepcion</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Dias Trans.</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Viaje</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_compras.addColumn("<html><b>C.Distr.</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Precio Venta</b></html>");
        jtable_modelo_compras.addColumn("<html><b>Observaciones</b></html>");
    }

private void iniciar_modelo_distribucionalma()
    {
            modelo = new javax.swing.DefaultListModel();



        jtable_modelo_distribucion=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_distribucion.addColumn("F.Dist.");
        jtable_modelo_distribucion.addColumn("Fecha");
        jtable_modelo_distribucion.addColumn("Codigo");
        jtable_modelo_distribucion.addColumn("Item");
        jtable_modelo_distribucion.addColumn("Costo");
        jtable_modelo_distribucion.addColumn("P.Michelle");
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_distribucion_clientes() as (id smallint,idcleinte character varying(12),ordenvisua smallint,clientenombre character varying(60));",variables_global.getconexiongral());
               while (rs.next())
                    {
                          jtable_modelo_distribucion.addColumn("<html><b>"+rs.getString("idcleinte")+":"+rs.getString("clientenombre")+"</b></html>");
                          modelo.addElement(rs.getString("idcleinte")+":"+rs.getString("clientenombre"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        jtable_modelo_distribucion.addColumn("Total");
    }
private void iniciar_modelo_existenciaentienda()
    {
        jtable_modelo_exisentienda=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_exisentienda.addColumn("Clave");
        jtable_modelo_exisentienda.addColumn("Descripcion.");
        jtable_modelo_exisentienda.addColumn("Item");
        jtable_modelo_exisentienda.addColumn("Cantidad");
        jtable_modelo_ventayexistencia=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_ventayexistencia.addColumn("Clave");
        jtable_modelo_ventayexistencia.addColumn("Descripcion.");
        jtable_modelo_ventayexistencia.addColumn("Item");
        jtable_modelo_ventayexistencia.addColumn("Cantidad");
        try
            {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas() as (tie_descri character varying(35),tie_id integer,tie_desesque character varying(25),idclie character varying(12));",variables_global.getconexiongral());
            while (rs.next())
                {
                    jtable_modelo_exisentienda.addColumn("<html><b>"+rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idclie")+"</b></html>");
                    jtable_modelo_ventayexistencia.addColumn("<html><b>"+rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idclie")+"</b></html>");
                }
            }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
        //jtable_modelo_ventayexistencia.addColumn("09:Almacen:09");
        //jtable_modelo_exisentienda.addColumn("09:Almacen:09");
    }
private void iniciar_modelo_comprasxfamilia()
        {
            jtable_modelo_comprasxfamilia=new javax.swing.table.DefaultTableModel();//Creo el modelo
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Familia</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Pzs Com</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Costo Com</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Pzas Vend.</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Costo Vend.</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>Precio Vend.</b></html>");
            jtable_modelo_comprasxfamilia.addColumn("<html><b>% Rotacion</b></html>");
        }
 private void iniciar_modelo_comprasxfam_detxprov()
        {
            jtable_modelo_comprasxfam_detprov=new javax.swing.table.DefaultTableModel();//Creo el modelo
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Id Fam</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Proveedor</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Pzas Com</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Costo Com</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Pzas Vend</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Costo Vend</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>Precio Ven</b></html>");
            jtable_modelo_comprasxfam_detprov.addColumn("<html><b>% rotacion</b></html>");
        }
 private void iniciar_modelo_comprasxfam_detxprov_arti()
        {
            jtable_modelo_comxfam_detpro_artis=new javax.swing.table.DefaultTableModel();//Creo el modelo
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Familia</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Proveedor</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Id Articulo</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Descripcion</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Costo</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>P.Publico</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Pzas Com</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Costo C.</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Costo C.I.</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>P.Publico</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Pz Vendidas</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Costo Vend</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>Precio Ven</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>E.bodega</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>E.Tienda</b></html>");
            jtable_modelo_comxfam_detpro_artis.addColumn("<html><b>% rot</b></html>");
        }
   private void iniciar_modelo_de_tabla() {
        jtable_modelo = new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Id</b></html>");
        jtable_modelo.addColumn("<html><b>Cod barra</b></html>");
        jtable_modelo.addColumn("<html><b>Familia</b></html>");
        jtable_modelo.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo.addColumn("<html><b>Id Doc</b></html>");
        jtable_modelo.addColumn("<html><b>Articulo</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo.addColumn("<html><b>Item p</b></html>");
        jtable_modelo.addColumn("<html><b>Item mi</b></html>");
        jtable_modelo.addColumn("<html><b>cant</b></html>");
        jtable_modelo.addColumn("<html><b>Costo</b></html>");
        jtable_modelo.addColumn("<html><b>Costo D.</b></html>");
        jtable_modelo.addColumn("<html><b>Precio</b></html>");
        jtable_modelo.addColumn("<html><b>Precio M</b></html>");
    }

   private void iniciar_modelo_artresumen()
{
        jtable_modelo_sie=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_sie.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Item.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_sie.addColumn("<html><b>F. Ult.Compra</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Acum V.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>Exis.</b></html>");
        jtable_modelo_sie.addColumn("<html><b>%Rotacion</b></html>");
}
    private void iniciar_modelo_resumenxsubfamilia() {
        jtable_modelo_proveedorestadistica = new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_proveedorestadistica.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>E. Piezas</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>E. Costo</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>E. Venta</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>V. Piezas</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>V. Costo</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>V. Precio</b></html>");
        jtable_modelo_proveedorestadistica.addColumn("<html><b>% Rotacion</b></html>");
    }


    private void iniciar_modelo_distribucion_resumen() {
        jtable_modelo_distribucion_resum = new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_distribucion_resum.addColumn("<html><b>Cliente</b></html>");
        jtable_modelo_distribucion_resum.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo_distribucion_resum.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_distribucion_resum.addColumn("<html><b>Costo I.</b></html>");
        jtable_modelo_distribucion_resum.addColumn("<html><b>%</b></html>");

    }

    private void iniciar_modelo_recpeciones()
    {

        jtable_modelo_rec=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_rec.addColumn("<html><b>Folio</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Status</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Cliente</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Doc. Ant.</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Fecha</b></html>");
        jtable_modelo_rec.addColumn("<html><b>F.llega Tienda</b></html>");
        jtable_modelo_rec.addColumn("<html><b>F.Recepcion</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Ref</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Pz</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Costo I</b></html>");
        jtable_modelo_rec.addColumn("<html><b>Costo</b></html>");


   }


private void carga_datos(int opbus, String tbusca) {
        String fechacat = "", fechallegatienda = "", fechaentrega = "", abrehtml = "", cierrahtml = "";
        DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
        float tpz=0,tco=0,tpv=0,tcd=0;
        Object[] fnewRow = new Object[14];

        //invoco al metodo que trae el recordset de datos

        try {
                rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_compras_catalogo(" + opbus + ",'" + tbusca + "') as (idreg integer,iddocumento character varying(12),idstatus smallint,statusdescribe character varying(15),doctoanterior character varying(12),fechadocto date,fechadoctoenmes text,idproveedor character varying(12),describeproveedor character varying(60),observadocto character varying(80),usuario character varying(20),impuestoporcen numeric,descuentototal numeric,clasificacion smallint,describeclasificacion character varying(30),clasifechainicio date,clasifechafin date,clavepersonaldoc character varying(45),docsiguiente character varying(12),fechaentrega date,fechavenci date,impuestoporcen2 numeric,descuentofinan numeric,piezas numeric,totalimporte numeric,totalprecio numeric,idsubfam smallint,diasenalmacen integer,diasproveealmacen integer,totalcostosal numeric);", variables_global.getconexiongral());
            while (rs.next())
                {
                if (rs.getInt("idstatus") > 3) {
                    abrehtml = "<html><b><font color=#CC0000>";
                    cierrahtml = "<font></b></html>";
                } else {
                    abrehtml="<html>";
                    cierrahtml="</html>";
                }
                fnewRow[0] = abrehtml + rs.getString("statusdescribe") + cierrahtml;
                fnewRow[1] = rs.getString("iddocumento");
                fnewRow[2] = abrehtml + rs.getString("doctoanterior") + cierrahtml;
                fnewRow[3] = abrehtml + this.fechaeuropea(rs.getString("fechadocto")) + ":<br>" + DiaSemana(this.fechaeuropea(rs.getString("fechadocto"))) + cierrahtml;
                if (rs.getString("fechaentrega") != null) {
                    fechallegatienda = abrehtml + this.fechaeuropea(rs.getString("fechaentrega")) + ":<br>" + DiaSemana(this.fechaeuropea(rs.getString("fechaentrega"))) + cierrahtml;
                }
                fnewRow[4] = fechallegatienda;
                if (rs.getString("fechavenci") != null)
                    {
                        fechaentrega = abrehtml + this.fechaeuropea(rs.getString("fechavenci")) + ":<br>" + this.DiaSemana(this.fechaeuropea(rs.getString("fechavenci"))) + cierrahtml;
                    }
                fnewRow[5] = fechaentrega;
                fnewRow[6] = "";
                fnewRow[7] = abrehtml + rs.getString("clasificacion") + ":" + rs.getString("describeclasificacion") + cierrahtml;
                fnewRow[8] = abrehtml + rs.getString("idproveedor") + ":" + rs.getString("describeproveedor") + cierrahtml;
                fnewRow[9] = abrehtml + miformat.format(rs.getFloat("piezas")) + cierrahtml;
                fnewRow[10] = abrehtml + miformat.format(rs.getFloat("totalimporte")) + cierrahtml;
                fnewRow[11] = abrehtml + miformat.format(rs.getFloat("totalcostosal")) + cierrahtml;
                fnewRow[12] = abrehtml + miformat.format(rs.getFloat("totalprecio")) + cierrahtml;
                fnewRow[13] = abrehtml + rs.getString("observadocto") + cierrahtml;
                jtable_modelo_compras.addRow(fnewRow);
                tpz+=rs.getFloat("piezas");
                tco+=rs.getFloat("totalimporte");
                tpv+=rs.getFloat("totalprecio");
                tcd+=rs.getFloat("totalcostosal");
            }

        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
                        fnewRow[0] ="";
                fnewRow[1] = "";
                fnewRow[2] = "";
                fnewRow[3] = "";

                fnewRow[4] = "";

                fnewRow[5] = "";
                fnewRow[6] = "";
                fnewRow[7] ="";
                fnewRow[8] = "<html><h3>Totales</h3></html>";
                fnewRow[9] = abrehtml + miformat.format(tpz) + cierrahtml;
                fnewRow[10] = abrehtml + miformat.format(tco) + cierrahtml;
                fnewRow[11] = abrehtml + miformat.format(tcd) + cierrahtml;
                fnewRow[12] = abrehtml + miformat.format(tpv) + cierrahtml;
                fnewRow[13] = "";
                jtable_modelo_compras.addRow(fnewRow);

        this.centrar_datos();
    }
private void cargar_datos_clasificacion(int opcion, int opbuscamp,String busqueda)
    {
      //se crea intancia de la clase conexion
      DecimalFormat miformat = new DecimalFormat("###,###,###,###");
      String fechallegatienda="",fechaentrega="";
      java.util.Date fechaestaeuropa=null;
       //rs = x.damecat_art(0,0,"");
       String texto="select * from x1distribucion_terminados_viajesv2("+opcion+","+opbuscamp+",'"+busqueda+"','','') as (id integer,descripclasif character varying(30),fechai date,fechafin date,pedimento character varying(255),observacion character varying(80),idsta smallint)";
       try
         {
           rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    fechallegatienda="";
                    fechaentrega="";

                    this.jtf_idviaje.setText(rs.getString("id"));
                    this.jtf_viajedescribe.setText(rs.getString("descripclasif"));
                    if (rs.getString("fechai")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechai"));
                                    this.jdc_fechainicio.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                            this.jlbl_diaini.setText(this.DiaSemana(rs.getString("fechai")));
                            this.setTitle(rs.getString("id")+":"+rs.getString("descripclasif")+" Fecha Inicio:"+this.fechaeuropea(rs.getString("fechai")));
                        }
                   if (rs.getString("fechafin")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechafin"));
                                    this.jdc_fechafin.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                            this.jlbl_diafin.setText(this.DiaSemana(rs.getString("fechafin")));
                        }
                    this.jtf_pedimento.setText(rs.getString("observacion"));
                    this.jtf_observaciones.setText(rs.getString("pedimento"));
                    this.jtf_idviajestatus.setText(rs.getString("idsta"));
                    if (rs.getInt("idsta")== 2)
                        {
                            this.jbtn_imprimirdetalle.setVisible(true);
                            this.jbtn_viajeimprimir.setVisible(true);
                        }
                    else
                        {
                            this.jbtn_imprimirdetalle.setVisible(false);
                            this.jbtn_viajeimprimir.setVisible(false);
                        }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
}

private void carga_datos_compras_xfamilia(String clasificacion)
    {
        //fecha es la final del reporte
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        //indicamos 7 columnas
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        float importe=0,totalpiezas=0,totcosto=0,pzascom=0,costocom=0,preciocom=0;

        //Voy por la venta del dia
        //serie1 = this.fechaeuropea(fechai)+" AL "+this.fechaeuropea(fecha);//fecha final de reporte
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2("select * from x1distribucion_terminados_compras_detalle_rotacion(5,'"+clasificacion+"','"+clasificacion+"','') as (canarti numeric,costoarti numeric,idfamilia character varying(5),idclasi smallint,clasidescrip character varying(30),cantidadarticulo real,importeneto double precision,importecosto double precision,utilidad double precision,familiadescribe character varying(40));",variables_global.getconexiongral());
                 while (rs.next())
                        {
                            pzascom+=rs.getFloat("canarti");
                            costocom+=rs.getFloat("costoarti");

                            totalpiezas+=rs.getFloat("cantidadarticulo");
                            totcosto+=rs.getFloat("importecosto");
                            importe+=rs.getFloat("importeneto");

                            jtable_modelo_comprasxfamilia.addRow(new Object[]{rs.getString("idfamilia")+":"+rs.getString ("familiadescribe"),miformat.format(rs.getFloat("canarti")),miformat.format(rs.getFloat("costoarti")),miformat.format(rs.getFloat("cantidadarticulo")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importeneto")),miformat.format((rs.getFloat("importecosto")/rs.getFloat("costoarti"))*100)+"%"});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            jtable_modelo_comprasxfamilia.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>","<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format((totcosto/costocom)*100)+"%</b></h3></html>"});
            this.centrar_datos();
 }

private void carga_datos_compras_xfam_detpro(int opcion,String clasif,String familia)
    {
        //fecha es la final del reporte
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        //indicamos 7 columnas
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        while(jtable_modelo_comprasxfam_detprov.getRowCount()>0)jtable_modelo_comprasxfam_detprov.removeRow(0);
        float importe=0,totalpiezas=0,totcosto=0,pzascom=0,costocom=0;
        //Voy por la venta del dia
        //serie1 = this.fechaeuropea(fechai)+" AL "+this.fechaeuropea(fecha);//fecha final de reporte
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                        rs=x.sieuno_executediversosv2("select * from x1distribucion_terminados_compras_detalle_rotacion("+opcion+",'"+clasif+"','"+familia+"','') as (canarti numeric,costoarti numeric,idfamilia character varying(5),idprovee character varying(12),proveedescrip character varying(60),idclasif smallint,descripclasif character varying(30),cantidadarticulo real,importeneto double precision,importecosto double precision,utilidad double precision,familiadescribe character varying(40));",variables_global.getconexiongral());
                 while (rs.next())
                        {
                            pzascom+=rs.getFloat("canarti");
                            costocom+=rs.getFloat("costoarti");

                            totalpiezas+=rs.getFloat("cantidadarticulo");
                            totcosto+=rs.getFloat("importecosto");
                            importe+=rs.getFloat("importeneto");
                            jtable_modelo_comprasxfam_detprov.addRow(new Object[]{rs.getString("idfamilia")+":"+rs.getString("familiadescribe"),rs.getString ("idprovee")+":"+rs.getString ("proveedescrip"),miformat.format(rs.getFloat("canarti")),miformat.format(rs.getFloat("costoarti")),miformat.format(rs.getFloat("cantidadarticulo")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importeneto")),miformat.format(((rs.getFloat("importecosto")/rs.getFloat("costoarti"))*100))+"%"});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            jtable_modelo_comprasxfam_detprov.addRow(new Object[]{"","<html><h3><b>Totales: </b></h3></html>","<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>","<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>",miformat.format((totcosto/costocom)*100)+"%"});
            this.centrar_datos();
 }
private void carga_datos_compras_xfam_detpro_arti(int opcion,String mes,String familia,String idprov)
    {
        //fecha es la final del reporte
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        //indicamos 7 columnas
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        while(jtable_modelo_comxfam_detpro_artis.getRowCount()>0)jtable_modelo_comxfam_detpro_artis.removeRow(0);
        float importe=0,totalpiezas=0,totcosto=0,pzascom=0,costocom=0,rotacion=0;
        Object[] fnewRow = new Object[15];
        String idpro="",textosql="select * from x1distribucion_terminados_compras_detalle_rotacion("+opcion+",'"+mes+"','"+familia+"','"+idprov+"') as (idregistro integer,iddocto character varying(12),idarticulo character varying(16),canarti numeric,costoarti numeric,descripcion character varying(80),idfamilia character varying(5),precio5 numeric,valorx character varying(20),idprovee character varying(12),proveedescrip character varying(60),idclasif smallint,descripclasif character varying(30),fechadocto text,idproducto integer,cantidadarticulo real,importeneto double precision,importecosto double precision,utilidad double precision);";
        //Voy por la venta del dia
        //serie1 = this.fechaeuropea(fechai)+" AL "+this.fechaeuropea(fecha);//fecha final de reporte
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
                 while (rs.next())
                        {

                        if (rs.getString("idproducto")!= null)
                            {
                                idpro=rs.getString("idproducto");
                            }
                        else
                            {
                                idpro="";
                            }
                        
                        if (rs.getString("cantidadarticulo")!= null)
                            {
                               rotacion=(rs.getFloat("importecosto")/(rs.getFloat("canarti")*rs.getFloat("costoarti")))*100;
                               fnewRow[0]=rs.getString("idprovee")+":"+rs.getString("proveedescrip");
                               fnewRow[1]=rs.getString("idarticulo")+"";
                               fnewRow[2]=idpro+":"+rs.getString("descripcion");
                               fnewRow[3]=rs.getString("valorx");
                               fnewRow[4]=miformat.format(rs.getFloat("canarti"));
                               fnewRow[5]=miformat.format(rs.getFloat("canarti")*rs.getFloat("costoarti"));
                               fnewRow[6]=miformat.format(rs.getFloat("cantidadarticulo"));
                               fnewRow[7]=miformat.format(rs.getFloat("importecosto"));
                               fnewRow[8]=miformat.format(rs.getFloat("importeneto"));
                               fnewRow[10]=miformat.format(rotacion)+"%";
                               pzascom+=rs.getFloat("canarti");
                               costocom+=(rs.getFloat("canarti")*rs.getFloat("costoarti"));
                               totalpiezas+=rs.getFloat("cantidadarticulo");
                               totcosto+=rs.getFloat("importecosto");
                               importe+=rs.getFloat("importeneto");
                               jtable_modelo_comxfam_detpro_artis.addRow(fnewRow);
                            }
                        else
                            {
                               fnewRow[0]=rs.getString("idprovee")+":"+rs.getString("proveedescrip");
                               fnewRow[1]=rs.getString("idarticulo")+"";
                               fnewRow[2]=idpro+":"+rs.getString("descripcion");
                               fnewRow[3]=rs.getString("valorx");
                               fnewRow[4]=miformat.format(rs.getFloat("canarti"));
                               fnewRow[5]=miformat.format(rs.getFloat("canarti")*rs.getFloat("costoarti"));
                               fnewRow[6]="";
                               fnewRow[7]="";
                               fnewRow[8]="";
                               fnewRow[9]="";
                               fnewRow[9]="";
                               jtable_modelo_comxfam_detpro_artis.addRow(fnewRow);
                            }
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            //jtable_modelo_comxfam_detpro_artis.addRow(new Object[]{"","<html><h3><b>Totales: </b></h3></html>","<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>","<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>",miformat.format((totcosto/costocom)*100)+"%"});
                               fnewRow[0]="";
                               fnewRow[1]="";
                               fnewRow[2]="";
                               fnewRow[3]="<html><h3><b>"+"Totales"+"</b></h3></html>";
                               fnewRow[4]="<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>";
                               fnewRow[5]="<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>";
                               fnewRow[6]="<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>";
                               fnewRow[7]="<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>";
                               fnewRow[8]="<html><h3><b>"+miformat.format(importe)+"</b></h3></html>";
                               fnewRow[9]="<html><h3><b>"+miformat.format((totcosto/costocom)*100)+"%"+"</b></h3></html>";
                               jtable_modelo_comxfam_detpro_artis.addRow(fnewRow);
                               this.centrar_datos();
 }
private void carga_datos_compras_xtienda(int opcion,String tie,String viaje,String idtienda,String fechai,String fechaf)
    {
        //fecha es la final del reporte
        DecimalFormat miformat = new DecimalFormat("############.####");
        //indicamos 7 columnas
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        while(jtable_modelo_comxfam_detpro_artis.getRowCount()>0)jtable_modelo_comxfam_detpro_artis.removeRow(0);
        double importe=0,totalpiezas=0,totcosto=0,pzascom=0,costocom=0,rotacion=0;
        Object[] fnewRow = new Object[15];
        String idpro="",textosql="select * from x1distribucion_terminados_compras_detalle_rotacion("+opcion+",'"+tie+"','"+viaje+"','') as (idarticulo character varying(16),canarti numeric,costoarti numeric,costoartii numeric,precioarti numeric,famdescrip character varying(40),proveedescrip character varying(60),descripcion character varying(80));";
        //Voy por la venta del dia
        //serie1 = this.fechaeuropea(fechai)+" AL "+this.fechaeuropea(fecha);//fecha final de reporte
        System.out.println(textosql);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
                 while (rs.next())
                        {
                               fnewRow[0]=rs.getString("famdescrip");
                               fnewRow[1]=rs.getString("proveedescrip")+"";
                               fnewRow[2]=rs.getString("idarticulo");
                               fnewRow[3]=rs.getString("descripcion");
                               fnewRow[4]=miformat.format(rs.getDouble("costoartii")/rs.getDouble("canarti"));
                               fnewRow[5]=miformat.format(rs.getDouble("precioarti")/rs.getDouble("canarti"));
                               fnewRow[6]=miformat.format(rs.getDouble("canarti"));
                               fnewRow[7]=miformat.format(rs.getDouble("costoarti"));
                               fnewRow[8]=miformat.format(rs.getDouble("costoartii"));
                               fnewRow[9]=miformat.format(rs.getDouble("precioarti"));
                               fnewRow[10]="0";
                               fnewRow[11]="0";
                               fnewRow[12]="0";
                               fnewRow[13]="0";
                               fnewRow[14]="0";
                               pzascom+=rs.getFloat("canarti");
                               costocom+=rs.getFloat("costoarti");
                               totcosto+=rs.getFloat("costoartii");
                               importe+=rs.getFloat("precioarti");
                               jtable_modelo_comxfam_detpro_artis.addRow(fnewRow);

                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
            //jtable_modelo_comxfam_detpro_artis.addRow(new Object[]{"","<html><h3><b>Totales: </b></h3></html>","<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>","<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>",miformat.format((totcosto/costocom)*100)+"%"});
                               fnewRow[0]="";
                               fnewRow[1]="";
                               fnewRow[2]="";
                               fnewRow[3]="<html><h3><b>"+"Totales"+"</b></h3></html>";
                               fnewRow[4]="";
                               fnewRow[5]="";
                               fnewRow[6]="<html><h3><b>"+miformat.format(pzascom)+"</b></h3></html>";
                               fnewRow[7]="<html><h3><b>"+miformat.format(costocom)+"</b></h3></html>";
                               fnewRow[8]="<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>";
                               fnewRow[9]="<html><h3><b>"+miformat.format(importe)+"</b></h3></html>";
                               fnewRow[10]="0";
                               fnewRow[11]="0";
                               fnewRow[12]="0";
                               fnewRow[13]="0";
                               fnewRow[14]="0";
                               jtable_modelo_comxfam_detpro_artis.addRow(fnewRow);
                               this.centrar_datos();

//****************************************************************voy por ventas
    int numerofilas = this.jtable_modelo_comxfam_detpro_artis.getRowCount(),ii=0;
    String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_comxfam_detpro_artis.getValueAt(ii ,2)+"";
                }

    System.out.println(selectin);

        String    texto="select * from x1sieuno_articulo_masvendidosv4(5,0,'"+idtienda+"','"+fechai+"','"+fechaf+"','"+selectin+"','') as (id integer, can real,importe double precision,clavepro character varying(16));";
        System.out.println(texto);
            try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                        this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("can"),1,miformat.format(rs.getDouble("importe")),"");
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }

             texto="select * from x1sieuno_articulo_detalle(7,"+idtienda+",'','"+selectin+"') as (clavepro character varying(16),exi numeric,exit numeric)";
        System.out.println(texto);
            try
                {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                        this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),2,rs.getString("exit"),"");
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
 }
private void crea_hoja_agregaexistencias(String codigo,String existencia,int columna,String smin,String smax)
    {
        DecimalFormat miformat = new DecimalFormat("############.####");
        DecimalFormat miformat2 = new DecimalFormat("############.##");
        int numerofilas=this.jtable_modelo_comxfam_detpro_artis.getRowCount(),ii=00,encontrado=0;
        String mesactual="",colorabre="",colorcierra="";
        double importe;
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_comxfam_detpro_artis.getValueAt(ii, 2).toString();
                    // System.out.println("Agregando:"+mesactual+" "+mes);
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            if(columna==1)
                                {
                                importe=(Float.valueOf(existencia)/Float.valueOf(jtable_modelo_comxfam_detpro_artis.getValueAt(ii, 6).toString()))*100;
                                jtable_modelo_comxfam_detpro_artis.setValueAt(existencia,ii ,10);
                                jtable_modelo_comxfam_detpro_artis.setValueAt(miformat.format(Float.valueOf(jtable_modelo_comxfam_detpro_artis.getValueAt(ii, 4).toString())*Float.valueOf(existencia)),ii ,11);
                                jtable_modelo_comxfam_detpro_artis.setValueAt(smin,ii ,12);
                                jtable_modelo_comxfam_detpro_artis.setValueAt(miformat2.format(importe)+"%",ii ,15);
                                }
                            if(columna==2)
                                {
                                jtable_modelo_comxfam_detpro_artis.setValueAt(existencia,ii ,13);
                                jtable_modelo_comxfam_detpro_artis.setValueAt(smin,ii ,14);
                                }
                            numerofilas=jtable_modelo_comxfam_detpro_artis.getRowCount();

                        }
                }
    }

private void carga_datos_recepciones(int opbus,String cliente,String tbusca)
    {
       String fechacat = "",fechallegatienda="",fechaentrega="";
       DecimalFormat miformat = new DecimalFormat("############.##");
       String abrehtml="",cierrahtml="",texto="";
       float tpz=0,timporte=0,timportec=0;
       while(jtable_modelo_rec.getRowCount()>0)jtable_modelo_rec.removeRow(0);
       texto="select * from x1distribucion_terminados_ventas_catalogov2('"+cliente+"',"+opbus+",'"+tbusca+"') as (id character varying(12),desta character varying(15),dante character varying(12), fedoc text,fechae2 text,idcliente character varying(12),nomclie character varying(60),obserdoc character varying(80), usuario character varying(20),total numeric,tpz numeric,fechae date,idpro character varying(12),prove character varying(60),totalc numeric,remision character varying(12));";
       //invoco al metodo que trae el recordset de datos
        System.out.println("ho:"+texto);
        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                tpz+=rs.getFloat("tpz");
                timporte+=rs.getFloat("total");
                timportec+=rs.getFloat("totalc");
                
                 if(rs.getString("fedoc")!=null)
                        {
                           fechallegatienda=""+ rs.getString("fedoc")+"";
                        }
                    if(rs.getString("fechae")!=null)
                        {
                            fechaentrega=""+rs.getString ("fechae")+"";
                        }
                fechacat=""+rs.getString("fedoc")+"";
                jtable_modelo_rec.addRow(new Object[]{rs.getString ("id"),rs.getString ("desta")+cierrahtml,abrehtml+rs.getString ("idcliente")+":"+rs.getString ("nomclie")+cierrahtml,abrehtml+rs.getString ("dante")+cierrahtml,fechacat,fechallegatienda,fechaentrega,abrehtml+rs.getString ("remision")+cierrahtml,abrehtml+rs.getString ("idpro")+":"+rs.getString ("prove")+cierrahtml,abrehtml+miformat.format(rs.getFloat("tpz"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("total"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("totalc"))+cierrahtml});
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        jtable_modelo_rec.addRow(new Object[]{"Total:","","","","","","","","",miformat.format(tpz),miformat.format(timporte),miformat.format(timportec)});
/*        texto="select * from x1distribucion_terminados_almacen_entradas_catalogo(2,'"+tbusca+"','') as (idfol integer,id character varying(12),idesta smallint,desta character varying(15),claveperdoc character varying(12),dante character varying(12),dsiguiente character varying(12), fedoc date,feent date,fechaven date,impuesto numeric,impuesto2 numeric,destotot numeric,destofinan numeric,idproveedor character varying(12), idprovdescribe character varying(60),obserdoc character varying(255),usuario character varying(12), flete numeric,guia character varying(60),fechaenvio date,idmoneda smallint,describemoneda character varying(30),idalmacen smallint,describealmacehr character varying(30),pzaente numeric,pzasal numeric,importeent numeric,importesal numeric);";
        System.out.println("ho:"+texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    if(rs.getString("fechaven") != null)
                        {
                           fechallegatienda="<html>"+ this.fechaeuropea(rs.getString("fechaven"))+":<br>"+DiaSemana(this.fechaeuropea(rs.getString ("fechaven")))+"</html>";
                        }
                    if(rs.getString("feent")!=null)
                        {
                            fechaentrega="<html>"+rs.getString ("feent")+":<br>"+this.DiaSemana(this.fechaeuropea(rs.getString("feent")))+"</html>";
                        }
                fechacat="<html>"+this.fechaeuropea(rs.getString ("fedoc"))+":<br>"+DiaSemana(this.fechaeuropea(rs.getString("fedoc"))+"</html>");
                switch (rs.getInt("idesta"))
                    {
                        case 1:
                            jtable_modelo.addRow(new Object[]{rs.getString ("id"),rs.getString("idesta")+":"+rs.getString("desta"),"09:Entrada Almacen",rs.getString ("dante"),fechacat,fechallegatienda,fechaentrega,"",abrehtml+rs.getString ("guia")+cierrahtml,abrehtml+miformat.format(rs.getFloat("pzasal"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("importesal"))+cierrahtml,abrehtml+rs.getString ("obserdoc")+cierrahtml});
                        break;
                        case 2:
                            jtable_modelo.addRow(new Object[]{rs.getString ("id"),rs.getString("idesta")+":"+rs.getString("desta"),"0:DIFERENCIA FALTANTE O SOBRANTE",rs.getString ("dante"),fechacat,fechallegatienda,fechaentrega,"",abrehtml+rs.getString ("guia")+cierrahtml,abrehtml+miformat.format(rs.getFloat("pzasal"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("importesal"))+cierrahtml,abrehtml+rs.getString ("obserdoc")+cierrahtml});
                        break;
                    }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
*/

       int numerofilas=this.jtable_modelo_rec.getRowCount();
             for(int i = 0 ;i < numerofilas; i++)
                {
                     jtbl_recepciones.setRowHeight(i, 30);
                }
         alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);

        jtbl_recepciones.getColumnModel().getColumn(9).setCellRenderer(alinearderecha);
        jtbl_recepciones.getColumnModel().getColumn(10).setCellRenderer(alinearderecha);
        //jtbl_recepciones.getColumnModel().getColumn(11).setCellRenderer(alinearderecha);

      }
private void imprimir_existencias(int pag,float totalp)
    {
     java.util.Date fechahoy=new Date();
     this.objimpresora=new com_distri_folios_imprimir();
     this.objimpresora.setOneItem_cadenas_a_imprimir("        Id_Rep:AE-01 Existencias Almacen");
     this.objimpresora.setOneItem_cadenas_a_imprimir("        "+variables_global.getDescribeaplicacion()+": EXISTENCIAS ALMACEN");
     this.objimpresora.setOneItem_cadenas_a_imprimir("        Fecha de Impresion:"+this.fechaeuropea(fechahoy)+"  Hora "+fechahoy.getHours()+":"+fechahoy.getMinutes());
     //this.objimprjcbx_tipoelementoesora.setOneItem_cadenas_a_imprimir("Fecha:"+this.+"");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.jtf_fecha.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("       ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+totalp);
    if((pag+1)>totalp)
        {
            //this.objimpresora.setOneItem_cadenas_a_imprimir("        Articulos:"+this.jlbl_cantidadregistros1.getText()+"");
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jtb_catalogo_articulos1);
     //this.objimpresora.setObjeto_tabla2(jtb_almacen_catalogo);
     this.objimpresora.imprimir_all(25,pag);
    }

private void jtb_comprascatalogoMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private int findcolumna_idtienda (String titulo)  {
  int columnas = jtable_modelo_distribucion.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_distribucion.getColumnName(j).replace("<html><b>","").split(":");
                     System.out.println("Busqueda:"+columtitulo[0]+" "+titulo);
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo[0]+" "+columencontrado);
                        }
                }
    return columencontrado;
}
private void crea_hoja_distribucionalmacen(String codigo,String cantidad,int columna,String item,float costo,float precio5,String foliodistri,String fecha)
    {
        DecimalFormat miformat = new DecimalFormat("#########.##");
        DecimalFormat miformat2 = new DecimalFormat("#########.##");
        int numerofilas=this.jtable_modelo_distribucion.getRowCount();
        String idstat="",foliodis="",canan="";
        int numerocolumnas=this.jtable_modelo_distribucion.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(cantidad);
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo_distribucion.getValueAt(ii, 2).toString();
                    foliodis=jtable_modelo_distribucion.getValueAt(ii, 0).toString();

                    if (idstat.equals(codigo))
                        {
                            System.out.println("Agregando:"+cantidad+" "+codigo);
                            encontrado=1;
                            canan=jtable_modelo_distribucion.getValueAt(ii, columna).toString();
                            jtable_modelo_distribucion.setValueAt(miformat.format(cantifam+Float.valueOf(canan)),ii ,columna);
                            //jtable_modelo_distribucion.setValueAt(foliodis+","+foliodistri,ii ,0);

                        }
                }
       if(encontrado==0)
            {
            fnewRow[0]=foliodistri;
            fnewRow[1]=fecha;
            fnewRow[2]=codigo;
            fnewRow[3]=item;
            fnewRow[4]=miformat2.format(costo);
            fnewRow[5]=miformat.format(precio5);
            for(ii=6;ii<numerocolumnas;ii++)
                {
                     //          System.out.println(mes);
                               if(ii==columna)
                                    {
                                        fnewRow[ii]=miformat.format(cantifam);
                                    }
                               else
                                    {
                                        fnewRow[ii]="0";
                                    }
                }
             jtable_modelo_distribucion.addRow(fnewRow);
           }
    }
private void carga_datos_distribucionalma(int opcion,String idviaje)
    {
       String fechaeuro="";
       int columnatitulo=0;
       String mespartido="";
   while(jtable_modelo_distribucion.getRowCount()>0)jtable_modelo_distribucion.removeRow(0);
   while(jtable_modelo_distribucion_resum.getRowCount()>0)jtable_modelo_distribucion_resum.removeRow(0);
   int ncol=this.jtable_modelo_distribucion.getColumnCount();
    Object[] fnewRow = new Object[ncol];
    rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_articulos_distribucion("+opcion+",'"+idviaje+"',1) as (folio integer,fechamov date,referenciainve character varying(12),clave_clie_prov character varying(16),idarticuloinve character varying(16),cantidadinve numeric,precioinve numeric,costoinve numeric,folioref smallint,idprovee character varying(12),precio5 numeric,valorxitem character varying(20),clasif1 smallint,doctoant character varying(12));",variables_global.getconexiongral());
        try
        {
            while (rs.next())
                {
                        mespartido=rs.getString("clave_clie_prov");
                        columnatitulo=this.findcolumna_idtienda(mespartido);
                        this.crea_hoja_distribucionalmacen(rs.getString("idarticuloinve"),rs.getString("cantidadinve"),columnatitulo,rs.getString("valorxitem"),rs.getFloat("costoinve"),rs.getFloat("precio5"),rs.getString("referenciainve"),this.fechaeuropea(rs.getString("fechamov")));
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
     fnewRow[0]="Total Piezas:";
     jtable_modelo_distribucion.addRow(fnewRow);
     fnewRow[0]="Total Importe:";
     jtable_modelo_distribucion.addRow(fnewRow);
     this.contruir_totales_distribucionalma();
     }
private void carga_datos_distribucionalma_tot(int opcion,String idviaje)
    {

   DecimalFormat miformat2 = new DecimalFormat("###,###,###,###.##");
   while(jtable_modelo_distribucion_resum.getRowCount()>0)jtable_modelo_distribucion_resum.removeRow(0);
   float pz=0,costo=0,precio=0;


        try
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_articulos_distribucion("+opcion+",'"+idviaje+"',1) as (clasif smallint,clave_clie_prov character varying(16),pz numeric,precio numeric,costo numeric,des character varying(60));",variables_global.getconexiongral());
            while (rs.next())
                {
                 jtable_modelo_distribucion_resum.addRow(new Object[]{rs.getString("clave_clie_prov")+":"+rs.getString("des"),miformat2.format(rs.getFloat("pz")),miformat2.format(rs.getFloat("costo")),miformat2.format(rs.getFloat("precio"))});
                 pz+=rs.getFloat("pz");
                 costo+=rs.getFloat("costo");
                 precio+=rs.getFloat("precio");
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        jtable_modelo_distribucion_resum.addRow(new Object[]{"Totales;",miformat2.format(pz),miformat2.format(costo),miformat2.format(precio)});
     }
private void contruir_totales_distribucionalma()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totgeneral=0,totalimporte=0,importegeneral=0;
         int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucion.getColumnCount()-7;
         //genero los totales por tienda
          System.out.println("aqui ta chingando la madre"+numerotiendas);
         for( ii=0;ii<numerotiendas;ii++)
            {
             totalve=0;
             totalimporte=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        totalve+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+6).toString().replace(",","").replace(".",""));
                        totalimporte+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+6).toString().replace(",","").replace(".",""))*Float.valueOf(jtable_modelo_distribucion.getValueAt(i, 4).toString());
                    }
                    jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+6);
                    jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalimporte)+"</b></h3></html>",i+1,ii+6);
                    jtable_modelo_distribucion_resum.addRow(new Object[]{jtable_modelo_distribucion.getColumnName(ii+6).replace("<html><b>","").replace("</b></html>",""),myFormatter.format(totalve),myFormatter.format(totalimporte),""});
                    totgeneral+=totalve;
                    importegeneral+=totalimporte;
            }
           this.jtf_totaldistribucion.setText(myFormatter.format(importegeneral));
           totalve=0;
           for(i=0;i<totalfilasreporte;i++)
                  {
                        totalve=0;
                        for( ii=0;ii<numerotiendas;ii++)
                        {
                            totalve+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+6).toString().replace(",","").replace(".",""));
                        }
                        jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+6);
                  }
           totalve=0;
           Object[] fnewRow = new Object[numerotiendas+6];
           fnewRow[0]="%";
           for( ii=0;ii<numerotiendas;ii++)
                {
                        totalve=Float.valueOf(jtable_modelo_distribucion.getValueAt(totalfilasreporte, ii+6).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                        System.out.println(totalve+"general en totales"+ totgeneral);
                        fnewRow[ii+6]="<html><h3><b>"+myFormatter.format((totalve/totgeneral)*100)+"%</b></h3></html>";
                }
           jtable_modelo_distribucion.addRow(fnewRow);
           totalve=0;
           for( ii=0;ii<this.jtable_modelo_distribucion_resum.getRowCount();ii++)
                {
                        totalve=Float.valueOf(jtable_modelo_distribucion_resum.getValueAt(ii,1).toString().replace(",","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                        System.out.println(totalve+"general"+ totgeneral);
                        jtable_modelo_distribucion_resum.setValueAt("<html><h3><b>"+myFormatter.format((totalve/totgeneral)*100)+"%</b></h3></html>",ii,3);
                }
          
     }
private void verexistencias()
        {
                       int numerofilas = this.jtable_modelo_ventayexistencia.getRowCount(),ii=0;
String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_ventayexistencia.getValueAt(ii ,0)+"";
                }

    System.out.println(selectin);

            String texto="select * from x1sieuno_articulo_detalle(1,0,'','"+selectin+"') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text)";
            System.out.println(texto);
            String despartido[]=null;
            int columnatitulo=0;
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");

                            columnatitulo=this.findcolumna_idtiendaet(despartido[0]);
                            System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                            if ( columnatitulo>0)
                                {
                                    this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),columnatitulo);
                                }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
           // texto="select * from x1sieuno_articulo_detalle(2,0,'','"+selectin+"') as (clavepro character varying(16),exi numeric)";
           // System.out.println(texto);

            //columnatitulo=0;
            //try
            //   {
            //   rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            //   while (rs.next())
            //        {
            //            columnatitulo=this.findcolumna_idtiendaet("09");
                        //System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
             //           if ( columnatitulo>0)
             //               {
             //                       this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),columnatitulo);
             //               }
             //       }
             //   }
            //catch(Exception e)
            //    {
            //        System.out.println(e.getMessage());
            //    }
        }

private void verexisyacumventas()
        {
            int numerofilas = this.jtable_modelo_ventayexistencia.getRowCount(),ii=0;
String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_ventayexistencia.getValueAt(ii ,0)+"";
                }

    System.out.println(selectin);

            String texto="select * from x1sieuno_articulo_detalle_ventasacum(1,0,'','"+selectin+"','') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,acumventas real)";
            System.out.println(texto);
            String despartido[]=null,colorabre="",colorcierra="",htmlabre="<html><body>",htmlcierra="</body></html>",existencia="",strven="",strexi="",strrot="";
            int columnatitulo=0;
            DecimalFormat myForma = new DecimalFormat("###,###,###,###");
            float piezas2=0,importe=0,acumulado=0,piezas=0;
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");

                            columnatitulo=this.findcolumna_idtiendaet(despartido[0]);
                            System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                            if(rs.getString("acumventas")!=null)
                                {
                                    piezas=rs.getFloat("acumventas");
                                    piezas2=rs.getFloat("exi");
                                    acumulado=piezas+piezas2;
                                    importe=(piezas/acumulado)*100;
                                }
                            else
                                {
                                    piezas=0;
                                    importe=0;
                                }

                                    colorabre="";
                                    colorcierra="";
                                    if (importe<=50)
                                            {
                                            colorabre="<b><font color=#CC0000>";
                                            colorcierra="<font></b>";
                                            }
                                    if ((importe>50) && (importe<=75))
                                            {
                                             colorabre="<b><font color=#FF6633>";
                                             colorcierra="<font></b>";
                                            }
                                      if (importe>75)
                                            {
                                             colorabre="<font color=#008000>";
                                             colorcierra="<font>";
                                            }
                                    if ((importe==0) && (rs.getFloat("exi")==0))
                                            {
                                             colorabre="";
                                             colorcierra="";
                                            }
                            strven=String.format("%1$-6s",myForma.format(piezas));
                            strexi=String.format("%1$-6s",myForma.format(rs.getFloat("exi")));
                            strrot=String.format("%1$-4s",myForma.format(importe)+"");
                            //existencia=htmlabre+colorabre+""+myForma.format(piezas)+" E"+rs.getString("exi")+"("+myForma.format(importe)+"%)"+colorcierra+htmlcierra;
                                    //existencia=htmlabre+"<tr><th>"+colorabre+""+String.format("%1$-8s",myForma.format(piezas))+colorcierra+"</th><th>"+colorabre+String.format("%1$-8s",myForma.format(rs.getFloat("exi")))+colorcierra+"</th><th>"+colorabre+String.format("%1$-8s",myForma.format(importe))+"%"+colorcierra+"</th></tr>"+htmlcierra;
                                    existencia=htmlabre+colorabre+""+strven.replace(" ", "&nbsp;")+strexi.replace(" ", "&nbsp;")+strrot.replace(" ", "&nbsp;")+colorcierra+htmlcierra;
                            if ( columnatitulo>0)
                                {
                                    this.crea_hoja_agregaacumven(rs.getString("clavepro"),existencia,columnatitulo);

                                }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
             texto="select * from x1sieuno_articulo_detalle_ventasacum(2,0,'','"+selectin+"','') as (clavepro character varying(16),exi numeric)";
            System.out.println(texto);

            columnatitulo=0;
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                        columnatitulo=this.findcolumna_idtiendaet("09");
                        //System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                        if ( columnatitulo>0)
                            {
                                    this.crea_hoja_agregaacumven(rs.getString("clavepro"),rs.getString("exi"),columnatitulo);
                            }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
                this.centrar_datos();
        }

private void cargar_datos(String viaje) {
        //se crea intancia de la clase conexion
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        DecimalFormat miformat2d = new DecimalFormat("###,###,###,###.##");
        DecimalFormat miformatsd = new DecimalFormat("############");
        Object[] fnewRow = new Object[14],fnewRowet = new Object[5],fnewRoweyvt=new Object[5];
        int folio=0;
        String fechallegatienda = "", fechaentrega = "";
        //rs = x.damecat_art(0,0,"");
        String texto = "select * from x1distribucion_terminados_entradas_detalle(3," + viaje + ",'','') as (idreg integer,iddocto character varying(12),idarti character varying(16),can_articuloent numeric,factor numeric,cant_articulosal numeric,costoent numeric,costosal numeric,importe numeric,obserparti character varying(60),artidescrip character varying(80),unidadsal character varying(3),controlalma character varying(20),descriptipo character varying(40),precio1 numeric,precio2 numeric,descorta character varying(20),unidadentrada character varying(3),itemprovee character varying(20),precio5 numeric,descripfam character varying(40),idprovee character varying(12),descripprovee character varying(60),fechadocto date,clasifviaje smallint,descripviaje character varying(30),codbarra character varying(16))";

        try {
            rs = x.sieuno_executediversosv2(texto, variables_global.getconexiongral());
            while (rs.next())
            {
                folio++;
                fnewRow[0] = folio;
                fnewRow[1] = rs.getString("codbarra");
                fnewRow[2] = rs.getString("descripfam");
                fnewRow[3] = rs.getString("idprovee") + ":" + rs.getString("descripprovee");
                fnewRow[4] = rs.getString("iddocto");
                fnewRow[5] = rs.getString("idarti");
                fnewRow[6] = rs.getString("artidescrip");
                fnewRow[7] = rs.getString("controlalma");
                fnewRow[8] = rs.getString("itemprovee");
                fnewRow[9] = miformat.format(rs.getFloat("cant_articulosal"));
                fnewRow[10] = miformat2d.format(rs.getFloat("costoent"));
                fnewRow[11] = miformat2d.format(rs.getFloat("costosal"));
                fnewRow[12] = miformat2d.format(rs.getFloat("precio5"));
                fnewRow[13] = miformat2d.format(rs.getFloat("precio2"));
                jtable_modelo.addRow(fnewRow);

                this.crea_hoja_exisentienda(rs.getString("idarti"),rs.getString("artidescrip"),rs.getString("itemprovee")+".",rs.getString("cant_articulosal"));
                this.crea_hoja_venyexis(rs.getString("idarti"),rs.getString("artidescrip"),rs.getString("itemprovee")+".",rs.getString("cant_articulosal"));

            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        this.executabusqueda_sie();
    }

private void cargar_datos_proveedorestadistica(String viaje) {
        //se crea intancia de la clase conexion
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        Object[] fnewRow = new Object[8];
        String fechallegatienda = "", fechaentrega = "";
        //rs = x.damecat_art(0,0,"");
        float epiezas = 0, eimporte = 0, eprecio = 0, vpiezas = 0, vcosto = 0, vimporte = 0;
        String texto = "select * from x1distribucion_terminados_viajes_subfamiliaestadistica(" + viaje + ") as (idclasif smallint,subfamilia smallint,viajepiezas numeric,totalimporte numeric,totalprecio numeric,ventacantpro real,ventacosto double precision,ventaimporte double precision,nombre character varying(50))";
        rs = x.sieuno_executediversosv2(texto, variables_global.getconexiongral());
        try {
            while (rs.next()) {
                epiezas += rs.getFloat("viajepiezas");
                eimporte += rs.getFloat("totalimporte");
                eprecio += rs.getFloat("totalprecio");
                vpiezas += rs.getFloat("ventacantpro");
                vcosto += rs.getFloat("ventacosto");
                vimporte += rs.getFloat("ventaimporte");

                fnewRow[0] = rs.getString("subfamilia") + ":" + rs.getString("nombre");
                fnewRow[1] = miformat.format(rs.getFloat("viajepiezas"));
                fnewRow[2] = miformat.format(rs.getFloat("totalimporte"));
                fnewRow[3] = miformat.format(rs.getFloat("totalprecio"));
                fnewRow[4] = miformat.format(rs.getFloat("ventacantpro"));
                fnewRow[5] = miformat.format(rs.getFloat("ventacosto"));
                fnewRow[6] = miformat.format(rs.getFloat("ventaimporte"));
                fnewRow[7] = miformat.format((rs.getFloat("ventacosto") / rs.getFloat("totalimporte")) * 100) + "%";
                jtable_modelo_proveedorestadistica.addRow(fnewRow);
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }


        fnewRow[0] = "Totales;";
        fnewRow[1] = miformat.format(epiezas);
        fnewRow[2] = miformat.format(eimporte);
        fnewRow[3] = miformat.format(eprecio);
        fnewRow[4] = miformat.format(vpiezas);
        fnewRow[5] = miformat.format(vcosto);
        fnewRow[6] = miformat.format(vimporte);
        fnewRow[7] = miformat.format((vcosto / eimporte) * 100) + "%";
        jtable_modelo_proveedorestadistica.addRow(fnewRow);
    }
private int findcolumna_idtiendaet (String titulo)  {
      int columnas = jtable_modelo_exisentienda.getColumnCount(),columencontrado=0;
      String columtitulo[]=null;
      for(int j = 3 ;j < columnas ; j++)
            {
                columtitulo= jtable_modelo_exisentienda.getColumnName(j).replace("<html><b>","").replace("</b></html>","").split(":");
                if(columtitulo[0].equals(titulo))
                    {
                            columencontrado=j;
                            j=columnas;
                    }
            }
    //System.out.println("Esto encontro:"+columencontrado);
    return columencontrado;
}
private void crea_hoja_agregaexistencias(String codigo,String existencia,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_exisentienda.getRowCount();
        String mesactual="";
        int numerocolumnas=this.jtable_modelo.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float abononumerico=0;
       //invoco al metodo que trae el recordset de datos
        abononumerico=Float.valueOf(existencia);
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_exisentienda.getValueAt(ii, 0).toString();
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            jtable_modelo_exisentienda.setValueAt(miformat.format(abononumerico),ii ,columna);
                        }
                }
    }
private void crea_hoja_agregaacumven(String codigo,String existencia,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_ventayexistencia.getRowCount();
        String mesactual="";
        int ii=00;
        int encontrado=0;

        //float abononumerico=0;
       //invoco al metodo que trae el recordset de datos
        //abononumerico=Float.valueOf(existencia);
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_ventayexistencia.getValueAt(ii, 0).toString();
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            jtable_modelo_ventayexistencia.setValueAt(existencia,ii ,columna);
                        }
                }
    }

private void crea_hoja_exisentienda(String codigo,String descripcion,String item,String cantidad)
    {
        DecimalFormat miformat = new DecimalFormat("#########.##");
        int numerofilasd=this.jtable_modelo_exisentienda.getRowCount();

        String idstat="",idclista="",idclientemodelo[]=null;
        int numerocolumnas=this.jtable_modelo_exisentienda.getColumnCount(),ii=00,encontrado=0,nclie=0,folioref=0;
        Object[] fnewRow = new Object[numerocolumnas],fnewRowdet = new Object[15];
        float cantiant=0;
       //reviso en la tabla de detalle si ya existe para solo aumentar la cantidad
        for( ii=0;ii<numerofilasd;ii++)
                {
                    idstat=jtable_modelo_exisentienda.getValueAt(ii, 0).toString();
                    if (idstat.equals(codigo.trim().toUpperCase()))
                        {
                            encontrado=1;
                            cantiant=Float.valueOf(jtable_modelo_exisentienda.getValueAt(ii, 3).toString());
                            jtable_modelo_exisentienda.setValueAt(miformat.format(Float.valueOf(cantidad)+cantiant),ii ,3);
                        }
                }
        //si ya existe significa que tambien existe ne distribucion y controlinterno de distribucion
       folioref=0;
       if(encontrado==0)
            {
            fnewRow[0]=codigo;
            fnewRow[1]=descripcion;
            fnewRow[2]=item;
            fnewRow[3]=cantidad;
            jtable_modelo_exisentienda.addRow(fnewRow);
           }
    }

private void crea_hoja_venyexis(String codigo,String descripcion,String item,String cantidad)
    {
        DecimalFormat miformat = new DecimalFormat("#########.##");
        int numerofilasd=this.jtable_modelo_ventayexistencia.getRowCount();

        String idstat="",idclista="",idclientemodelo[]=null;
        int numerocolumnas=this.jtable_modelo_ventayexistencia.getColumnCount(),ii=00,encontrado=0,nclie=0,folioref=0;
        Object[] fnewRow = new Object[numerocolumnas],fnewRowdet = new Object[15];
        float cantiant=0;
       //reviso en la tabla de detalle si ya existe para solo aumentar la cantidad
        for( ii=0;ii<numerofilasd;ii++)
                {
                    idstat=jtable_modelo_ventayexistencia.getValueAt(ii, 1).toString();
                    if (idstat.equals(codigo.trim().toUpperCase()))
                        {
                            encontrado=1;
                            cantiant=Float.valueOf(jtable_modelo_ventayexistencia.getValueAt(ii, 3).toString());
                            jtable_modelo_ventayexistencia.setValueAt(miformat.format(Float.valueOf(cantidad)+cantiant),ii ,3);
                        }
                }
        //si ya existe significa que tambien existe ne distribucion y controlinterno de distribucion
       folioref=0;
       if(encontrado==0)
            {
            fnewRow[0]=codigo;
            fnewRow[1]=descripcion;
            fnewRow[2]=item;
            fnewRow[3]=cantidad;
            jtable_modelo_ventayexistencia.addRow(fnewRow);
           }
    }


private String fechaeuropea(String fecha) {

        //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa = null;
        SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
        String cadenafecha = "";
        try {
            fechaestaeuropa = formateadoresta.parse(fecha);
        } catch (ParseException e) {
            //Error, la cadena de texto no se puede convertir en fecha.
        }
        cadenafecha = formateadorestaeuropa.format(fechaestaeuropa);
        return cadenafecha;

    }

private void carga_datos_fotospaginacion(int pagina)
    {
        String textohtml="";
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag.getText().toString());
        float totalpaginas=this.jtable_modelo.getRowCount()/artxpag;

        this.jlbl_paginas.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
  System.out.println("filas x pagina"+artxpag+"tOTAL FILAS:"+this.jtable_modelo.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>"+jtable_modelo.getValueAt(ni, 5).toString()+"<br>"+jtable_modelo.getValueAt(ni, 6).toString()+ " "+jtable_modelo.getValueAt(ni, 9).toString()+ "  $"+jtable_modelo.getValueAt(ni, 10).toString()+ "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo.getValueAt(ni, 5).toString()+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=5)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }

private String DiaSemana(String fe) {
        String dia = "";
        java.util.Date fecha = null;
        try {
            fecha = formateador.parse(fe);

        } catch (ParseException e) {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal = Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }
    private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;
    }
private void contruir_grafica_distribuciontotal()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-3,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucion.getColumnCount()-7;
         float totalve=0;
         for( ii=0;ii<numerotiendas;ii++)
            {
                System.out.println(totalfilasreporte);
                totalve=Float.valueOf(jtable_modelo_distribucion.getValueAt(totalfilasreporte, ii+6).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                titulografico=jtable_modelo_distribucion.getColumnName(ii+6).replace("<html><b>","").replace("</b></html>","");
                if(totalve>0)
                    {
                        datasetbarra.addValue(totalve,titulografico,"Tiendas");
                    }
            }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas de Distribucion del viaje",datasetbarra,"Distribucion Viaje:"+this.jtf_viajedescribe.getText(),"Entrada de Piezas");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }

private void find_textoenjtable(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-3,i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_distribucion.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtbl_distribucion.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);
    }


private void centrar_datos(){

alinearCentro = new DefaultTableCellRenderer();
alinearCentro.setHorizontalAlignment(SwingConstants.CENTER);

alinearderecha = new DefaultTableCellRenderer();
alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);
int numerocol = this.jtable_modelo_ventayexistencia.getColumnCount(),ii=0;

for( ii=0;ii<numerocol;ii++)
    {
    if (ii==3)
            {
                jtbl_ventayexis.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
            }
        if (ii>3)
            {
                jtbl_ventayexis.getColumnModel().getColumn(ii).setCellRenderer(alinearCentro);
            }
    }
      jtb_comprascatalogo.getColumnModel().getColumn(9).setCellRenderer(alinearderecha);
        jtb_comprascatalogo.getColumnModel().getColumn(10).setCellRenderer(alinearderecha);
        jtb_comprascatalogo.getColumnModel().getColumn(11).setCellRenderer(alinearderecha);


        jtb_comxfamilias.getColumnModel().getColumn(1).setCellRenderer(alinearderecha);
        jtb_comxfamilias.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
        jtb_comxfamilias.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
        jtb_comxfamilias.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
        jtb_comxfamilias.getColumnModel().getColumn(5).setCellRenderer(alinearderecha);

        jtb_comxfamilias.getColumnModel().getColumn(6).setCellRenderer(alinearCentro);



        jtb_comxfam_detalleprov.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov.getColumnModel().getColumn(5).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov.getColumnModel().getColumn(6).setCellRenderer(alinearderecha);

        jtb_comxfam_detalleprov.getColumnModel().getColumn(7).setCellRenderer(alinearCentro);


        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(5).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(6).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(7).setCellRenderer(alinearderecha);
        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(8).setCellRenderer(alinearderecha);

        jtb_comxfam_detalleprov_artis.getColumnModel().getColumn(9).setCellRenderer(alinearCentro);

numerocol = this.jtable_modelo_exisentienda.getColumnCount();

for( ii=0;ii<numerocol;ii++)
    {
    if (ii==3)
            {
                jtbl_existenciaentie.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
            }
        if (ii>3)
            {
                jtbl_existenciaentie.getColumnModel().getColumn(ii).setCellRenderer(alinearCentro);
            }
    }

   jtbl_distribucion1.getColumnModel().getColumn(1).setCellRenderer(alinearderecha);
   jtbl_distribucion1.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
   jtbl_distribucion1.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);

}
private void loadcombo()
    {
     this.jcbx_tiendas.addItem("0:General");
          try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas(7,'','') as (tie_descri character varying(35),tie_id integer,tie_desesque character varying(25),idclie character varying(12));",variables_global.getconexiongral());
               while (rs.next())
                    {
                          this.jcbx_tiendas.addItem(rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idclie"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        
}
private void dioclicklis(java.awt.event.MouseEvent evt)
    {
        // TODO add your handling code here:
    String cli[]=this.jlst_clientesdistribucion.getSelectedValue().toString().split(":");
    this.jtf_clientedetalle.setText(this.jlst_clientesdistribucion.getSelectedValue().toString());
    this.carga_datos_recepciones(10,cli[0],this.jtf_idviaje.getText());
    }
private void jtbl_distribucionMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtb_comxfamiliasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
 private void jtb_comxfam_detalleprov_artisMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void dioclickd(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_distribucion.getSelectedColumn();
         int folio=0;
         int fila = jtbl_distribucion.getSelectedRow();
         String idcadena=this.jtbl_distribucion.getValueAt(fila, 2).toString();

         try
             {
                rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
                while (rs.next())
                        {
                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }
private void dioclicksiearticulo(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_comxfam_detalleprov_artis.getSelectedRow();
         String valor[] = jtb_comxfam_detalleprov_artis.getValueAt(fila, 2).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
    }
private void dioclicket(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_existenciaentie.getSelectedColumn();
         int folio=0;
         int fila = jtbl_existenciaentie.getSelectedRow();
         String idcadena=this.jtbl_existenciaentie.getValueAt(fila, 0).toString();

         try
             {
                rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
                while (rs.next())
                        {
                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }
private void dioclickav(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_ventayexis.getSelectedColumn();
         int folio=0;
         int fila = jtbl_ventayexis.getSelectedRow();
         String idcadena=this.jtbl_ventayexis.getValueAt(fila, 0).toString();
         try
             {
                rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
                while (rs.next())
                        {
                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }


 private void executabusqueda_sie()
 {
     float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
      DecimalFormat myForma = new DecimalFormat("############");
      DecimalFormat myForma2 = new DecimalFormat("############.##");
     String texto2="",htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="",busqueda="";

      int fila=0,banderafin=0,i=0;

        while(jtable_modelo_sie.getRowCount()>0)jtable_modelo_sie.removeRow(0);
 for (i=0;i<jtable_modelo.getRowCount();i++)
                {
                    if (i>0)
                        {
                            busqueda+=".";
                        }
                    busqueda+=""+jtable_modelo.getValueAt(i,5)+"";
                }

        Object[] fnewRow = new Object[12];
        String texto="select * from x1sieuno_articulo_catalogov3(12,1,'"+busqueda+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25),idbase character varying(16),descorta character varying(20),exis numeric,acumpzv numeric,acumimport numeric)";
        System.out.println("Catalogo "+texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                  fnewRow[0]=rs.getString("tementr");
                  fnewRow[1]=rs.getString("nomfa");
                  fnewRow[2]=rs.getString("nomsub")+"("+rs.getString("sub")+")";
                  fnewRow[3]=rs.getString("id")+":"+rs.getString("cla");
                  fnewRow[4]=rs.getString("des").replace("/", " ");
                  fnewRow[5]=rs.getString("it");
                  fnewRow[6]=myForma2.format(rs.getFloat("ultimocosto"));
                  fnewRow[7]=rs.getString("pre");
                  fnewRow[8]=this.fechaeuropea(rs.getString ("fe"));
                  fnewRow[9]=myForma.format(rs.getFloat("acumpzv"));
                  fnewRow[10]=myForma.format(rs.getFloat("exis"));

                        piezas=rs.getFloat("acumpzv");
                        piezas2=rs.getFloat("exis");
                        acumulado=piezas+piezas2;
                        importe=(piezas/acumulado)*100;
                        colorabre="";
                        colorcierra="";
                        if (importe<=50)
                            {
                                colorabre="<b><font color=#CC0000>";
                                colorcierra="<font></b>";
                            }
                        if ((importe>50) && (importe<=75))
                            {
                                colorabre="<b><font color=#0000FF>";
                                colorcierra="<font></b>";
                            }
                        if (importe>75)
                            {
                                colorabre="<b><font color=#00FF00>";
                                colorcierra="<font></b>";
                            }
                  fnewRow[11]=htmlabre+colorabre+myForma.format(importe)+"%"+colorcierra+htmlcierra;
                  jtable_modelo_sie.addRow(fnewRow);

                  banderafin=1;
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
this.jtf_idarticulos.setText(String.valueOf(this.jtable_modelo_sie.getRowCount()));


    if(banderafin==0)
         {
           JOptionPane.showMessageDialog(null,"Clave:"+busqueda+" No Encontrado", "Sistema Integral(Modificar articulo) : Ayuda",1);
         }
 }
 private void dioclickfotovye(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtbl_ventayexis.getSelectedRow();

         this.jtf_fotoidveyex.setText(jtable_modelo_ventayexistencia.getValueAt(fila, 0).toString());
         this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_ventayexistencia.getValueAt(fila, 0).toString()+".JPG\" width=\"180\" height=\"150\" border=\"0\" alt=\"Foto Articulo\"></img>");
    }
 private void dioclicketfoto(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtbl_existenciaentie.getSelectedRow();

         this.jtf_fotoidexitie.setText(jtable_modelo_exisentienda.getValueAt(fila, 0).toString());
         this.jep_articuloimagen1.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_exisentienda.getValueAt(fila, 0).toString()+".JPG\" width=\"180\" height=\"135\" border=\"0\" alt=\"Foto Articulo\"></img>");
    }
 private void dioclickdfoto(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtbl_distribucion.getSelectedRow();

         this.jtf_fotoiddistri.setText(jtable_modelo_distribucion.getValueAt(fila, 2).toString());
         this.jep_articuloimagen2.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_distribucion.getValueAt(fila, 2).toString()+".JPG\" width=\"180\" height=\"132\" border=\"0\" alt=\"Foto Articulo\"></img>");
    }
  private void dioclickfoto(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos.getSelectedRow();
         this.jtf_fotoiddetar.setText(jtable_modelo.getValueAt(fila, 5).toString());
         this.jep_articuloimagen3.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo.getValueAt(fila, 5).toString()+".JPG\" width=\"260\" height=\"160\" border=\"0\" alt=\"Foto Articulo\"></img>");
    }
private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;
    }

private void imprimir_articulosviaje(int pag,float ptotal)
    {

     java.util.Date fechahoya=new Date();

     this.objimpresora2=new com_distri_articulos_almacen_imprimir();
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          Fecha de Reporte:"+this.fechaeuropea(fechahoya)+"  Hora"+fechahoya.getHours()+":"+fechahoya.getMinutes());
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          S.I.:Compras Viaje(Articulos");
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          VIAJE:"+this.jtf_viajedescribe.getText()+"");
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          Fecha Inicio:"+this.fechaeuropea(this.jdc_fechainicio.getDate())+"        Fecha Fin:"+this.fechaeuropea(this.jdc_fechafin.getDate()));
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          Pedimeto:"+this.jtf_pedimento.getText()+" ");
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jtf_observaciones.getText()+" ");
     this.objimpresora2.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora2.setOneItem_cadenas_a_imprimir("          Articulos:"+ pag + " de "+ptotal+"");
     if((pag+1)>ptotal)
        {
        this.objimpresora2.setOneItem_cadenas_a_imprimir("          Articulos: "+this.jtf_idarticulos.getText());

        }
     this.objimpresora2.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora2.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora2.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora2.setObjeto_tabla(jtbl_distribucion1);
     this.objimpresora2.imprimir_all(1,pag);
    }
private void imprimir_detalle(int pag,float ptotal,String folio)
    {
     java.util.Date fechahoya=new Date();
     this.objimpresora=new com_distri_folios_imprimir();
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep:C4                            S.I.:Compras(Distribucion de Compra,Folios por viaje en Tiendas");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha de Reporte:"+this.fechaeuropea(fechahoya)+"  Hora"+fechahoya.getHours()+":"+fechahoya.getMinutes());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Viaje:"+this.jtf_viajedescribe.getText()+"");

     //this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Inicio:"+this.fechaeuropea(this.jdc_fechainicio.getDate())+"        Fecha Fin:"+this.fechaeuropea(this.jdc_fechafin.getDate()));
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pedimeto:"+this.jtf_pedimento.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jtf_observaciones.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Cliente/Tienda:"+this.jtf_clientedetalle.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     /*if((pag+1)>ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Piezas: "+this.jtf_totalpiezas.getText()+"       Subtotal: $"+this.jtf_doctosubtotal.getText()+"           Descuento:$"+this.jtf_doctodesc.getText()+"           Impuesto:$"+this.jtf_doctoimp.getText()+"           Total: $"+this.jtf_doctototal.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Recibidas: "+this.jtf_totalpiezas1.getText()+"       Subtotal:$"+this.jtf_doctosubtotal1.getText()+"           Descuento:$"+this.jtf_doctodesc1.getText()+"           Impuesto:$"+this.jtf_doctoimp1.getText()+"           Total: $"+this.jtf_doctototal1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Difencia:" +this.jtf_totalpiezasdif.getText()+"       Costo sin iva/sin desc. Faltante/Sobrante:$"+this.jtf_costodif.getText()+"             Total Diferencia:"+this.jtf_costodif1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("..");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Costo Integrado Recibido: "+this.jtf_doctototalpd1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Importe Flete: $"+this.jtf_flete.getText());
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
*/
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jtbl_recepciones);
     this.objimpresora.imprimir_all(21,pag);
    }

private void exportar_archivocompleto()
    {
        FileWriter fichero = null;
        PrintWriter pw = null;
        Object jtunidad=JOptionPane.showInputDialog(null,"Ingresa Unidad:","Unidades",JOptionPane.QUESTION_MESSAGE,null,new Object[] { "C", "D", "E","F","G","H" },"C");
        String texto="select * from x1distribucion_terminados_entradas_detalle(4,"+this.jtf_idviaje.getText()+",'','') as (cla character varying(16));",anterior="";
        System.out.println(texto);
        try
        {
            fichero = new FileWriter(jtunidad.toString()+":/fotos_"+this.jtf_idviaje.getText()+".html");
            pw = new PrintWriter(fichero);
            pw.println("<html><body><table>");
            try
                {
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {

                                    pw.println("<tr><th>"+rs.getString("cla")+"<br><img src=\"http://www.accesoriosmichelle.com/fotos/"+rs.getString("cla")+".jpg\" width=\"350\" height=\"200\" border=\"0\" alt=\"Foto Articulo\"></img></th><tr>");

                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
        pw.println("</table></body></html>");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           try {
           // Nuevamente aprovechamos el finally para
           // asegurarnos que se cierra el fichero.
           if (null != fichero)
              fichero.close();
                JOptionPane.showMessageDialog(null,"Archivo correcto "+jtunidad.toString()+":/fotos_"+this.jtf_idviaje.getText()+".html", "Sistema Integral(Catalogo de Articulos)",1);
           } catch (Exception e2) {
              e2.printStackTrace();
           }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtb_comprascatalogo = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        };
        jPanel9 = new javax.swing.JPanel();
        jtf_viajedescribe = new javax.swing.JTextField();
        jtf_idviaje = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jdc_fechainicio = new com.toedter.calendar.JDateChooser();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jdc_fechafin = new com.toedter.calendar.JDateChooser();
        jLabel4 = new javax.swing.JLabel();
        jtf_observaciones = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtf_pedimento = new javax.swing.JTextField();
        jlbl_diaini = new javax.swing.JLabel();
        jlbl_diafin = new javax.swing.JLabel();
        jbtn_guardar = new javax.swing.JButton();
        jbtn_viajecerrar = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jtf_idviajestatus = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane17 = new javax.swing.JScrollPane();
        jep_articuloimagen3 = new javax.swing.JEditorPane();
        jbtn_imagenfull = new javax.swing.JButton();
        jtf_fotoiddetar = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_catalogo_articulos = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jButton1 = new javax.swing.JButton();
            jPanel6 = new javax.swing.JPanel();
            jLabel17 = new javax.swing.JLabel();
            jrbtn_columnaclave1 = new javax.swing.JRadioButton();
            jrbtn_item1 = new javax.swing.JRadioButton();
            jLabel18 = new javax.swing.JLabel();
            jtf_buscarenjtable = new javax.swing.JTextField();
            jlb_resultado = new javax.swing.JLabel();
            jPanel14 = new javax.swing.JPanel();
            jScrollPane13 = new javax.swing.JScrollPane();
            jep_articuloimagen2 = new javax.swing.JEditorPane();
            jbtn_imagenfull1 = new javax.swing.JButton();
            jtf_fotoiddistri = new javax.swing.JTextField();
            jchk_graficadistribucion = new javax.swing.JCheckBox();
            jtf_idfolio = new javax.swing.JTextField();
            jbtn_busqueda = new javax.swing.JButton();
            jtf_totaldistribucion = new javax.swing.JTextField();
            jPanel19 = new javax.swing.JPanel();
            jScrollPane4 = new javax.swing.JScrollPane();
            jtbl_distribucion = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jPanel21 = new javax.swing.JPanel();
                jScrollPane8 = new javax.swing.JScrollPane();
                jtbl_distribucion1 = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }}
                    ;
                    jPanel7 = new javax.swing.JPanel();
                    jScrollPane14 = new javax.swing.JScrollPane();
                    jtb_comxfamilias = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        ;
                        jScrollPane15 = new javax.swing.JScrollPane();
                        jtb_comxfam_detalleprov = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}
                            ;
                            ;
                            jchxb_verdetallefamrotacion = new javax.swing.JCheckBox();
                            jScrollPane16 = new javax.swing.JScrollPane();
                            jtb_comxfam_detalleprov_artis = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                ;
                                jchxb_verdetallefamrotacion1 = new javax.swing.JCheckBox();
                                jcbx_tiendas = new javax.swing.JComboBox();
                                jbtn_generareporte = new javax.swing.JButton();
                                jLabel29 = new javax.swing.JLabel();
                                jdc_fechainicial = new com.toedter.calendar.JDateChooser();
                                jLabel30 = new javax.swing.JLabel();
                                jdc_fechafinal = new com.toedter.calendar.JDateChooser();
                                jPanel1 = new javax.swing.JPanel();
                                jPanel8 = new javax.swing.JPanel();
                                jPanel15 = new javax.swing.JPanel();
                                jScrollPane12 = new javax.swing.JScrollPane();
                                jep_articuloimagen1 = new javax.swing.JEditorPane();
                                jbtn_imagenfull2 = new javax.swing.JButton();
                                jPanel17 = new javax.swing.JPanel();
                                jScrollPane5 = new javax.swing.JScrollPane();
                                jtbl_existenciaentie = new javax.swing.JTable(){
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }}
                                    ;
                                    jtf_fotoidexitie = new javax.swing.JTextField();
                                    jPanel10 = new javax.swing.JPanel();
                                    jPanel11 = new javax.swing.JPanel();
                                    jLabel6 = new javax.swing.JLabel();
                                    jPanel16 = new javax.swing.JPanel();
                                    jScrollPane11 = new javax.swing.JScrollPane();
                                    jep_articuloimagen = new javax.swing.JEditorPane();
                                    jbtn_imagenfull3 = new javax.swing.JButton();
                                    jPanel18 = new javax.swing.JPanel();
                                    jScrollPane6 = new javax.swing.JScrollPane();
                                    jtbl_ventayexis = new javax.swing.JTable(){
                                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                                            return false;
                                        }}
                                        ;
                                        jtf_fotoidveyex = new javax.swing.JTextField();
                                        jPanel12 = new javax.swing.JPanel();
                                        jScrollPane7 = new javax.swing.JScrollPane();
                                        jepn_fotos = new javax.swing.JEditorPane();
                                        jtf_fotosartxpag = new javax.swing.JTextField();
                                        jlbl_paginas = new javax.swing.JLabel();
                                        jbtn_anterior = new javax.swing.JButton();
                                        jtf_paginaactual = new javax.swing.JTextField();
                                        jbtn_siguiente = new javax.swing.JButton();
                                        jPanel22 = new javax.swing.JPanel();
                                        jPanel23 = new javax.swing.JPanel();
                                        jScrollPane9 = new javax.swing.JScrollPane();
                                        jtbl_recepciones = new javax.swing.JTable(){
                                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                                return false;
                                            }}
                                            ;
                                            jScrollPane10 = new javax.swing.JScrollPane();
                                            jlst_clientesdistribucion = new javax.swing.JList();
                                            jtf_clientedetalle = new javax.swing.JTextField();
                                            jbtn_imprimirdetalle = new javax.swing.JButton();
                                            jPanel24 = new javax.swing.JPanel();
                                            jPanel25 = new javax.swing.JPanel();
                                            jScrollPane2 = new javax.swing.JScrollPane();
                                            jtb_catalogo_articulos1 = new javax.swing.JTable(){
                                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                                    return false;
                                                }}
                                                ;
                                                jbtn_viajeimprimir = new javax.swing.JButton();
                                                jLabel8 = new javax.swing.JLabel();
                                                jtf_idarticulos = new javax.swing.JTextField();
                                                jMenuBar1 = new javax.swing.JMenuBar();
                                                jMenu1 = new javax.swing.JMenu();
                                                jmni_salir = new javax.swing.JMenuItem();
                                                jmni_resumenprov = new javax.swing.JMenu();
                                                jmni_guardar = new javax.swing.JMenuItem();
                                                jmni_escape = new javax.swing.JMenuItem();
                                                jmni_imprimirdistri = new javax.swing.JMenuItem();
                                                jmni_printresumen = new javax.swing.JMenuItem();
                                                jMenuItem1 = new javax.swing.JMenuItem();

                                                setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                                                org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(com_distri_clasif_viajes_detalle.class);
                                                setTitle(resourceMap.getString("Form.title")); // NOI18N
                                                setName("Form"); // NOI18N

                                                jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                                jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                                    public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                                        jTabbedPane1StateChanged(evt);
                                                    }
                                                });

                                                jPanel2.setName("jPanel2"); // NOI18N

                                                jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
                                                jPanel5.setName("jPanel5"); // NOI18N

                                                jScrollPane3.setName("jScrollPane3"); // NOI18N

                                                jtb_comprascatalogo.setModel(this.jtable_modelo_compras);
                                                jtb_comprascatalogo.setName("jtb_comprascatalogo"); // NOI18N
                                                jtb_comprascatalogo.setRowHeight(28);
                                                jtb_comprascatalogo.getTableHeader().setReorderingAllowed(false);
                                                jtb_comprascatalogo.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_comprascatalogoMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclic(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane3.setViewportView(jtb_comprascatalogo);

                                                javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                                jPanel5.setLayout(jPanel5Layout);
                                                jPanel5Layout.setHorizontalGroup(
                                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1011, Short.MAX_VALUE)
                                                );
                                                jPanel5Layout.setVerticalGroup(
                                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
                                                );

                                                jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
                                                jPanel9.setName("jPanel9"); // NOI18N

                                                jtf_viajedescribe.setText(resourceMap.getString("jtf_viajedescribe.text")); // NOI18N
                                                jtf_viajedescribe.setName("jtf_viajedescribe"); // NOI18N
                                                jtf_viajedescribe.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_viajedescribeActionPerformed(evt);
                                                    }
                                                });

                                                jtf_idviaje.setEditable(false);
                                                jtf_idviaje.setText(resourceMap.getString("jtf_idviaje.text")); // NOI18N
                                                jtf_idviaje.setName("jtf_idviaje"); // NOI18N

                                                jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                                jLabel1.setName("jLabel1"); // NOI18N

                                                jdc_fechainicio.setToolTipText(resourceMap.getString("jdc_fechainicio.toolTipText")); // NOI18N
                                                jdc_fechainicio.setDateFormatString(resourceMap.getString("jdc_fechainicio.dateFormatString")); // NOI18N
                                                jdc_fechainicio.setName("jdc_fechainicio"); // NOI18N
                                                jdc_fechainicio.addKeyListener(new java.awt.event.KeyAdapter() {
                                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                                        jdc_fechainicioKeyPressed(evt);
                                                    }
                                                });

                                                jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                                                jLabel2.setName("jLabel2"); // NOI18N

                                                jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                                jLabel3.setName("jLabel3"); // NOI18N

                                                jdc_fechafin.setToolTipText(resourceMap.getString("jdc_fechafin.toolTipText")); // NOI18N
                                                jdc_fechafin.setDateFormatString(resourceMap.getString("jdc_fechafin.dateFormatString")); // NOI18N
                                                jdc_fechafin.setName("jdc_fechafin"); // NOI18N
                                                jdc_fechafin.addKeyListener(new java.awt.event.KeyAdapter() {
                                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                                        jdc_fechafinKeyPressed(evt);
                                                    }
                                                });

                                                jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                                jLabel4.setName("jLabel4"); // NOI18N

                                                jtf_observaciones.setName("jtf_observaciones"); // NOI18N
                                                jtf_observaciones.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_observacionesActionPerformed(evt);
                                                    }
                                                });

                                                jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                                jLabel5.setName("jLabel5"); // NOI18N

                                                jtf_pedimento.setName("jtf_pedimento"); // NOI18N
                                                jtf_pedimento.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_pedimentoActionPerformed(evt);
                                                    }
                                                });

                                                jlbl_diaini.setFont(resourceMap.getFont("jlbl_diaini.font")); // NOI18N
                                                jlbl_diaini.setText(resourceMap.getString("jlbl_diaini.text")); // NOI18N
                                                jlbl_diaini.setName("jlbl_diaini"); // NOI18N

                                                jlbl_diafin.setFont(resourceMap.getFont("jlbl_diafin.font")); // NOI18N
                                                jlbl_diafin.setText(resourceMap.getString("jlbl_diafin.text")); // NOI18N
                                                jlbl_diafin.setName("jlbl_diafin"); // NOI18N

                                                jbtn_guardar.setIcon(resourceMap.getIcon("jbtn_guardar.icon")); // NOI18N
                                                jbtn_guardar.setText(resourceMap.getString("jbtn_guardar.text")); // NOI18N
                                                jbtn_guardar.setName("jbtn_guardar"); // NOI18N
                                                jbtn_guardar.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_guardarActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_viajecerrar.setIcon(resourceMap.getIcon("jbtn_viajecerrar.icon")); // NOI18N
                                                jbtn_viajecerrar.setText(resourceMap.getString("jbtn_viajecerrar.text")); // NOI18N
                                                jbtn_viajecerrar.setName("jbtn_viajecerrar"); // NOI18N
                                                jbtn_viajecerrar.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_viajecerrarActionPerformed(evt);
                                                    }
                                                });

                                                jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                                jLabel7.setName("jLabel7"); // NOI18N

                                                jtf_idviajestatus.setEditable(false);
                                                jtf_idviajestatus.setName("jtf_idviajestatus"); // NOI18N

                                                javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                                                jPanel9.setLayout(jPanel9Layout);
                                                jPanel9Layout.setHorizontalGroup(
                                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                                .addContainerGap()
                                                                .addComponent(jLabel1)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_idviaje, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel5))
                                                        .addGap(28, 28, 28)
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel9Layout.createSequentialGroup()
                                                                .addComponent(jtf_viajedescribe, javax.swing.GroupLayout.PREFERRED_SIZE, 376, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 399, Short.MAX_VALUE)
                                                                .addComponent(jbtn_viajecerrar))
                                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                                        .addComponent(jdc_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                        .addComponent(jlbl_diaini, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                                    .addComponent(jtf_pedimento, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jdc_fechafin, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jlbl_diafin, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jLabel7)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jtf_idviajestatus, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                                        .addComponent(jLabel4)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jtf_observaciones, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addGap(90, 90, 90)
                                                                        .addComponent(jbtn_guardar)))))
                                                        .addContainerGap())
                                                );
                                                jPanel9Layout.setVerticalGroup(
                                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jtf_idviaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel1)
                                                            .addComponent(jtf_viajedescribe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_viajecerrar))
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                                .addGap(12, 12, 12)
                                                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                    .addComponent(jLabel2)
                                                                    .addComponent(jdc_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(jlbl_diaini)
                                                                        .addComponent(jLabel3))))
                                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(jlbl_diafin)
                                                                        .addComponent(jtf_idviajestatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jLabel7))
                                                                    .addComponent(jdc_fechafin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                        .addGap(20, 20, 20)
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jtf_pedimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel5)
                                                            .addComponent(jLabel4)
                                                            .addComponent(jtf_observaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_guardar)))
                                                );

                                                javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                                jPanel2.setLayout(jPanel2Layout);
                                                jPanel2Layout.setHorizontalGroup(
                                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                                        .addGap(10, 10, 10)
                                                        .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );
                                                jPanel2Layout.setVerticalGroup(
                                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

                                                jPanel4.setName("jPanel4"); // NOI18N

                                                jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
                                                jPanel3.setName("jPanel3"); // NOI18N

                                                jPanel13.setName("jPanel13"); // NOI18N

                                                jScrollPane17.setName("jScrollPane17"); // NOI18N

                                                jep_articuloimagen3.setContentType(resourceMap.getString("jep_articuloimagen3.contentType")); // NOI18N
                                                jep_articuloimagen3.setName("jep_articuloimagen3"); // NOI18N
                                                jScrollPane17.setViewportView(jep_articuloimagen3);

                                                jbtn_imagenfull.setFont(resourceMap.getFont("jbtn_imagenfull.font")); // NOI18N
                                                jbtn_imagenfull.setIcon(resourceMap.getIcon("jbtn_imagenfull.icon")); // NOI18N
                                                jbtn_imagenfull.setText(resourceMap.getString("jbtn_imagenfull.text")); // NOI18N
                                                jbtn_imagenfull.setToolTipText(resourceMap.getString("jbtn_imagenfull.toolTipText")); // NOI18N
                                                jbtn_imagenfull.setName("jbtn_imagenfull"); // NOI18N
                                                jbtn_imagenfull.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imagenfullActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
                                                jPanel13.setLayout(jPanel13Layout);
                                                jPanel13Layout.setHorizontalGroup(
                                                    jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jbtn_imagenfull)
                                                        .addGap(41, 41, 41))
                                                );
                                                jPanel13Layout.setVerticalGroup(
                                                    jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel13Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jbtn_imagenfull, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                                        .addGap(116, 116, 116))
                                                    .addGroup(jPanel13Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );

                                                jtf_fotoiddetar.setFont(resourceMap.getFont("jtf_fotoiddetar.font")); // NOI18N
                                                jtf_fotoiddetar.setText(resourceMap.getString("jtf_fotoiddetar.text")); // NOI18N
                                                jtf_fotoiddetar.setName("jtf_fotoiddetar"); // NOI18N

                                                jScrollPane1.setName("jScrollPane1"); // NOI18N

                                                jtb_catalogo_articulos.setModel(this.jtable_modelo);
                                                jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
                                                jtb_catalogo_articulos.setRowHeight(22);
                                                jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_catalogo_articulosMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickfoto(evt);
                                                            //System.out.println(" double click" );
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclick(evt);
                                                            //System.out.println(" double click" );
                                                        }
                                                    }
                                                });
                                                jScrollPane1.setViewportView(jtb_catalogo_articulos);

                                                jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
                                                jButton1.setName("jButton1"); // NOI18N
                                                jButton1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jButton1ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                                jPanel3.setLayout(jPanel3Layout);
                                                jPanel3Layout.setHorizontalGroup(
                                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jtf_fotoiddetar, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(71, 71, 71)
                                                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(109, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1008, Short.MAX_VALUE)
                                                );
                                                jPanel3Layout.setVerticalGroup(
                                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addGap(11, 11, 11)
                                                                .addComponent(jtf_fotoiddetar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addGap(30, 30, 30)
                                                                .addComponent(jButton1))
                                                            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 393, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                );

                                                javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                                jPanel4.setLayout(jPanel4Layout);
                                                jPanel4Layout.setHorizontalGroup(
                                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );
                                                jPanel4Layout.setVerticalGroup(
                                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

                                                jPanel6.setName("jPanel6"); // NOI18N

                                                jLabel17.setFont(resourceMap.getFont("jLabel17.font")); // NOI18N
                                                jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
                                                jLabel17.setName("jLabel17"); // NOI18N

                                                jrbtn_columnaclave1.setText(resourceMap.getString("jrbtn_columnaclave1.text")); // NOI18N
                                                jrbtn_columnaclave1.setActionCommand(resourceMap.getString("jrbtn_columnaclave1.actionCommand")); // NOI18N
                                                jrbtn_columnaclave1.setName("jrbtn_columnaclave1"); // NOI18N
                                                jrbtn_columnaclave1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_columnaclave1ActionPerformed(evt);
                                                    }
                                                });

                                                jrbtn_item1.setText(resourceMap.getString("jrbtn_item1.text")); // NOI18N
                                                jrbtn_item1.setActionCommand(resourceMap.getString("jrbtn_item1.actionCommand")); // NOI18N
                                                jrbtn_item1.setName("jrbtn_item1"); // NOI18N
                                                jrbtn_item1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_item1ActionPerformed(evt);
                                                    }
                                                });

                                                jLabel18.setFont(resourceMap.getFont("jLabel18.font")); // NOI18N
                                                jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
                                                jLabel18.setName("jLabel18"); // NOI18N

                                                jtf_buscarenjtable.setName("jtf_buscarenjtable"); // NOI18N
                                                jtf_buscarenjtable.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_buscarenjtableActionPerformed(evt);
                                                    }
                                                });

                                                jlb_resultado.setFont(resourceMap.getFont("jlb_resultado.font")); // NOI18N
                                                jlb_resultado.setText(resourceMap.getString("jlb_resultado.text")); // NOI18N
                                                jlb_resultado.setName("jlb_resultado"); // NOI18N

                                                jPanel14.setName("jPanel14"); // NOI18N

                                                jScrollPane13.setName("jScrollPane13"); // NOI18N

                                                jep_articuloimagen2.setContentType(resourceMap.getString("jep_articuloimagen2.contentType")); // NOI18N
                                                jep_articuloimagen2.setName("jep_articuloimagen2"); // NOI18N
                                                jScrollPane13.setViewportView(jep_articuloimagen2);

                                                jbtn_imagenfull1.setFont(resourceMap.getFont("jbtn_imagenfull1.font")); // NOI18N
                                                jbtn_imagenfull1.setIcon(resourceMap.getIcon("jbtn_imagenfull1.icon")); // NOI18N
                                                jbtn_imagenfull1.setText(resourceMap.getString("jbtn_imagenfull1.text")); // NOI18N
                                                jbtn_imagenfull1.setToolTipText(resourceMap.getString("jbtn_imagenfull1.toolTipText")); // NOI18N
                                                jbtn_imagenfull1.setName("jbtn_imagenfull1"); // NOI18N
                                                jbtn_imagenfull1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imagenfull1ActionPerformed(evt);
                                                    }
                                                });

                                                jtf_fotoiddistri.setFont(resourceMap.getFont("jtf_fotoiddistri.font")); // NOI18N
                                                jtf_fotoiddistri.setName("jtf_fotoiddistri"); // NOI18N

                                                jchk_graficadistribucion.setText(resourceMap.getString("jchk_graficadistribucion.text")); // NOI18N
                                                jchk_graficadistribucion.setName("jchk_graficadistribucion"); // NOI18N
                                                jchk_graficadistribucion.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jchk_graficadistribucionActionPerformed(evt);
                                                    }
                                                });

                                                jtf_idfolio.setFont(resourceMap.getFont("jtf_idfolio.font")); // NOI18N
                                                jtf_idfolio.setToolTipText(resourceMap.getString("jtf_idfolio.toolTipText")); // NOI18N
                                                jtf_idfolio.setName("jtf_idfolio"); // NOI18N
                                                jtf_idfolio.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_idfolioActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_busqueda.setIcon(resourceMap.getIcon("jbtn_busqueda.icon")); // NOI18N
                                                jbtn_busqueda.setText(resourceMap.getString("jbtn_busqueda.text")); // NOI18N
                                                jbtn_busqueda.setToolTipText(resourceMap.getString("jbtn_busqueda.toolTipText")); // NOI18N
                                                jbtn_busqueda.setName("jbtn_busqueda"); // NOI18N
                                                jbtn_busqueda.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_busquedaActionPerformed(evt);
                                                    }
                                                });

                                                jtf_totaldistribucion.setEditable(false);
                                                jtf_totaldistribucion.setFont(resourceMap.getFont("jtf_totaldistribucion.font")); // NOI18N
                                                jtf_totaldistribucion.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                                jtf_totaldistribucion.setToolTipText(resourceMap.getString("jtf_totaldistribucion.toolTipText")); // NOI18N
                                                jtf_totaldistribucion.setName("jtf_totaldistribucion"); // NOI18N

                                                javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
                                                jPanel14.setLayout(jPanel14Layout);
                                                jPanel14Layout.setHorizontalGroup(
                                                    jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jtf_fotoiddistri, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_imagenfull1)
                                                            .addComponent(jchk_graficadistribucion))
                                                        .addContainerGap())
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jtf_idfolio, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jbtn_busqueda)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jtf_totaldistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(18, Short.MAX_VALUE))
                                                );
                                                jPanel14Layout.setVerticalGroup(
                                                    jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jbtn_imagenfull1, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jtf_fotoiddistri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jchk_graficadistribucion)
                                                        .addGap(71, 71, 71))
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                .addComponent(jbtn_busqueda)
                                                                .addComponent(jtf_totaldistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jtf_idfolio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addContainerGap())
                                                );

                                                jPanel19.setName("jPanel19"); // NOI18N

                                                jScrollPane4.setName("jScrollPane4"); // NOI18N

                                                jtbl_distribucion.setModel(this.jtable_modelo_distribucion);
                                                jtbl_distribucion.setName("jtbl_distribucion"); // NOI18N
                                                jtbl_distribucion.setRowHeight(22);
                                                jtbl_distribucion.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtbl_distribucionMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickdfoto(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickd(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane4.setViewportView(jtbl_distribucion);

                                                javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
                                                jPanel19.setLayout(jPanel19Layout);
                                                jPanel19Layout.setHorizontalGroup(
                                                    jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1019, Short.MAX_VALUE)
                                                );
                                                jPanel19Layout.setVerticalGroup(
                                                    jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE)
                                                );

                                                jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel21.border.title"))); // NOI18N
                                                jPanel21.setName("jPanel21"); // NOI18N

                                                jScrollPane8.setName("jScrollPane8"); // NOI18N

                                                jtbl_distribucion1.setModel(this.jtable_modelo_distribucion_resum);
                                                jtbl_distribucion1.setName("jtbl_distribucion1"); // NOI18N
                                                jtbl_distribucion1.setRowHeight(22);
                                                jtbl_distribucion.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtbl_distribucionMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickdfoto(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickd(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane8.setViewportView(jtbl_distribucion1);

                                                javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
                                                jPanel21.setLayout(jPanel21Layout);
                                                jPanel21Layout.setHorizontalGroup(
                                                    jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)
                                                );
                                                jPanel21Layout.setVerticalGroup(
                                                    jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                                                );

                                                javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                                jPanel6.setLayout(jPanel6Layout);
                                                jPanel6Layout.setHorizontalGroup(
                                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                                                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                            .addGroup(jPanel6Layout.createSequentialGroup()
                                                                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addGroup(jPanel6Layout.createSequentialGroup()
                                                                        .addGap(25, 25, 25)
                                                                        .addComponent(jLabel17)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                        .addComponent(jrbtn_columnaclave1)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jrbtn_item1)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jLabel18)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jlb_resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                    .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addContainerGap())
                                                );
                                                jPanel6Layout.setVerticalGroup(
                                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel6Layout.createSequentialGroup()
                                                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(jPanel6Layout.createSequentialGroup()
                                                                .addContainerGap()
                                                                .addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(jlb_resultado)
                                                                    .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(jLabel18)
                                                                    .addComponent(jrbtn_item1)
                                                                    .addComponent(jrbtn_columnaclave1)
                                                                    .addComponent(jLabel17)))
                                                            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

                                                jPanel7.setName("jPanel7"); // NOI18N

                                                jScrollPane14.setName("jScrollPane14"); // NOI18N

                                                jtb_comxfamilias.setFont(resourceMap.getFont("jtb_comxfamilias.font")); // NOI18N
                                                jtb_comxfamilias.setModel(this.jtable_modelo_comprasxfamilia);
                                                jtb_comxfamilias.setName("jtb_comxfamilias"); // NOI18N
                                                jtb_comxfamilias.setRowHeight(20);
                                                jtb_comxfamilias.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_comxfamiliasMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamdet(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane14.setViewportView(jtb_comxfamilias);

                                                jScrollPane15.setName("jScrollPane15"); // NOI18N

                                                jtb_comxfam_detalleprov.setFont(resourceMap.getFont("jtb_comxfam_detalleprov.font")); // NOI18N
                                                jtb_comxfam_detalleprov.setModel(this.jtable_modelo_comprasxfam_detprov);
                                                jtb_comxfam_detalleprov.setName("jtb_comxfam_detalleprov"); // NOI18N
                                                jtb_comxfam_detalleprov.setRowHeight(20);
                                                jtb_comxfam_detalleprov.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_comxfam_detalleprovMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamdet_artis(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane15.setViewportView(jtb_comxfam_detalleprov);

                                                jchxb_verdetallefamrotacion.setText(resourceMap.getString("jchxb_verdetallefamrotacion.text")); // NOI18N
                                                jchxb_verdetallefamrotacion.setName("jchxb_verdetallefamrotacion"); // NOI18N
                                                jchxb_verdetallefamrotacion.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jchxb_verdetallefamrotacionActionPerformed(evt);
                                                    }
                                                });

                                                jScrollPane16.setName("jScrollPane16"); // NOI18N

                                                jtb_comxfam_detalleprov_artis.setFont(resourceMap.getFont("jtb_comxfam_detalleprov_artis.font")); // NOI18N
                                                jtb_comxfam_detalleprov_artis.setModel(this.jtable_modelo_comxfam_detpro_artis);
                                                jtb_comxfam_detalleprov_artis.setName("jtb_comxfam_detalleprov_artis"); // NOI18N
                                                jtb_comxfam_detalleprov_artis.setRowHeight(20);
                                                jtb_comxfam_detalleprov_artis.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_comxfam_detalleprov_artisMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclicksiearticulo(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane16.setViewportView(jtb_comxfam_detalleprov_artis);

                                                jchxb_verdetallefamrotacion1.setText(resourceMap.getString("jchxb_verdetallefamrotacion1.text")); // NOI18N
                                                jchxb_verdetallefamrotacion1.setName("jchxb_verdetallefamrotacion1"); // NOI18N
                                                jchxb_verdetallefamrotacion1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jchxb_verdetallefamrotacion1ActionPerformed(evt);
                                                    }
                                                });

                                                jcbx_tiendas.setToolTipText(resourceMap.getString("jcbx_tiendas.toolTipText")); // NOI18N
                                                jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
                                                jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jcbx_tiendasActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_generareporte.setText(resourceMap.getString("jbtn_generareporte.text")); // NOI18N
                                                jbtn_generareporte.setToolTipText(resourceMap.getString("jbtn_generareporte.toolTipText")); // NOI18N
                                                jbtn_generareporte.setName("jbtn_generareporte"); // NOI18N
                                                jbtn_generareporte.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_generareporteActionPerformed(evt);
                                                    }
                                                });

                                                jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
                                                jLabel29.setName("jLabel29"); // NOI18N

                                                jdc_fechainicial.setToolTipText(resourceMap.getString("jdc_fechainicial.toolTipText")); // NOI18N
                                                jdc_fechainicial.setDateFormatString(resourceMap.getString("jdc_fechainicial.dateFormatString")); // NOI18N
                                                jdc_fechainicial.setName("jdc_fechainicial"); // NOI18N
                                                jdc_fechainicial.addInputMethodListener(new java.awt.event.InputMethodListener() {
                                                    public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
                                                    }
                                                    public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
                                                        jdc_fechainicialInputMethodTextChanged(evt);
                                                    }
                                                });
                                                jdc_fechainicial.addKeyListener(new java.awt.event.KeyAdapter() {
                                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                                        jdc_fechainicialKeyPressed(evt);
                                                    }
                                                });

                                                jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
                                                jLabel30.setName("jLabel30"); // NOI18N

                                                jdc_fechafinal.setToolTipText(resourceMap.getString("jdc_fechafinal.toolTipText")); // NOI18N
                                                jdc_fechafinal.setDateFormatString(resourceMap.getString("jdc_fechafinal.dateFormatString")); // NOI18N
                                                jdc_fechafinal.setMaxSelectableDate(new java.util.Date(253370790102000L));
                                                jdc_fechafinal.setName("jdc_fechafinal"); // NOI18N

                                                javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                                jPanel7.setLayout(jPanel7Layout);
                                                jPanel7Layout.setHorizontalGroup(
                                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addComponent(jchxb_verdetallefamrotacion)
                                                                    .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 1007, Short.MAX_VALUE)
                                                                    .addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 1007, Short.MAX_VALUE))
                                                                .addContainerGap())
                                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                                .addComponent(jchxb_verdetallefamrotacion1)
                                                                .addGap(65, 65, 65)
                                                                .addComponent(jLabel29)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jdc_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 133, Short.MAX_VALUE)
                                                                .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jbtn_generareporte)
                                                                .addGap(31, 31, 31))))
                                                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                                            .addContainerGap()
                                                            .addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 1007, Short.MAX_VALUE)
                                                            .addContainerGap()))
                                                );
                                                jPanel7Layout.setVerticalGroup(
                                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                                .addComponent(jchxb_verdetallefamrotacion)
                                                                .addGap(182, 182, 182)
                                                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(jchxb_verdetallefamrotacion1)
                                                                    .addComponent(jbtn_generareporte)
                                                                    .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                                .addComponent(jLabel30)
                                                                .addComponent(jLabel29, javax.swing.GroupLayout.Alignment.TRAILING)
                                                                .addComponent(jdc_fechainicial, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                .addComponent(jdc_fechafinal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                                            .addGap(195, 195, 195)
                                                            .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addContainerGap(227, Short.MAX_VALUE)))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

                                                jPanel1.setName("jPanel1"); // NOI18N

                                                jPanel8.setName("jPanel8"); // NOI18N

                                                jPanel15.setName("jPanel15"); // NOI18N

                                                jScrollPane12.setName("jScrollPane12"); // NOI18N

                                                jep_articuloimagen1.setContentType(resourceMap.getString("jep_articuloimagen1.contentType")); // NOI18N
                                                jep_articuloimagen1.setName("jep_articuloimagen1"); // NOI18N
                                                jScrollPane12.setViewportView(jep_articuloimagen1);

                                                jbtn_imagenfull2.setFont(resourceMap.getFont("jbtn_imagenfull2.font")); // NOI18N
                                                jbtn_imagenfull2.setIcon(resourceMap.getIcon("jbtn_imagenfull2.icon")); // NOI18N
                                                jbtn_imagenfull2.setText(resourceMap.getString("jbtn_imagenfull2.text")); // NOI18N
                                                jbtn_imagenfull2.setToolTipText(resourceMap.getString("jbtn_imagenfull2.toolTipText")); // NOI18N
                                                jbtn_imagenfull2.setName("jbtn_imagenfull2"); // NOI18N
                                                jbtn_imagenfull2.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imagenfull2ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
                                                jPanel15.setLayout(jPanel15Layout);
                                                jPanel15Layout.setHorizontalGroup(
                                                    jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel15Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jbtn_imagenfull2)
                                                        .addContainerGap(13, Short.MAX_VALUE))
                                                );
                                                jPanel15Layout.setVerticalGroup(
                                                    jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel15Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jbtn_imagenfull2, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                                        .addGap(142, 142, 142))
                                                    .addGroup(jPanel15Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                jPanel17.setName("jPanel17"); // NOI18N

                                                jScrollPane5.setName("jScrollPane5"); // NOI18N

                                                jtbl_existenciaentie.setFont(resourceMap.getFont("jtbl_existenciaentie.font")); // NOI18N
                                                jtbl_existenciaentie.setModel(this.jtable_modelo_exisentienda);
                                                jtbl_existenciaentie.setName("jtbl_existenciaentie"); // NOI18N
                                                jtbl_existenciaentie.setRowHeight(22);
                                                jtbl_existenciaentie.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtbl_existenciaentieMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclicketfoto(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclicket(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane5.setViewportView(jtbl_existenciaentie);

                                                javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
                                                jPanel17.setLayout(jPanel17Layout);
                                                jPanel17Layout.setHorizontalGroup(
                                                    jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 1007, Short.MAX_VALUE)
                                                );
                                                jPanel17Layout.setVerticalGroup(
                                                    jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel17Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE))
                                                );

                                                jtf_fotoidexitie.setFont(resourceMap.getFont("jtf_fotoidexitie.font")); // NOI18N
                                                jtf_fotoidexitie.setName("jtf_fotoidexitie"); // NOI18N

                                                javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                                jPanel8.setLayout(jPanel8Layout);
                                                jPanel8Layout.setHorizontalGroup(
                                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel8Layout.createSequentialGroup()
                                                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel8Layout.createSequentialGroup()
                                                                .addGap(95, 95, 95)
                                                                .addComponent(jtf_fotoidexitie, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(56, 56, 56)
                                                                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jPanel17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                        .addContainerGap())
                                                );
                                                jPanel8Layout.setVerticalGroup(
                                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                                                        .addGap(11, 11, 11)
                                                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jtf_fotoidexitie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(113, 113, 113))
                                                );

                                                javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                                jPanel1.setLayout(jPanel1Layout);
                                                jPanel1Layout.setHorizontalGroup(
                                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );
                                                jPanel1Layout.setVerticalGroup(
                                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

                                                jPanel10.setName("jPanel10"); // NOI18N

                                                jPanel11.setName("jPanel11"); // NOI18N

                                                jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
                                                jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                                jLabel6.setName("jLabel6"); // NOI18N

                                                jPanel16.setName("jPanel16"); // NOI18N

                                                jScrollPane11.setName("jScrollPane11"); // NOI18N

                                                jep_articuloimagen.setContentType(resourceMap.getString("jep_articuloimagen.contentType")); // NOI18N
                                                jep_articuloimagen.setName("jep_articuloimagen"); // NOI18N
                                                jScrollPane11.setViewportView(jep_articuloimagen);

                                                jbtn_imagenfull3.setFont(resourceMap.getFont("jbtn_imagenfull3.font")); // NOI18N
                                                jbtn_imagenfull3.setIcon(resourceMap.getIcon("jbtn_imagenfull3.icon")); // NOI18N
                                                jbtn_imagenfull3.setText(resourceMap.getString("jbtn_imagenfull3.text")); // NOI18N
                                                jbtn_imagenfull3.setToolTipText(resourceMap.getString("jbtn_imagenfull3.toolTipText")); // NOI18N
                                                jbtn_imagenfull3.setName("jbtn_imagenfull3"); // NOI18N
                                                jbtn_imagenfull3.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imagenfull3ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
                                                jPanel16.setLayout(jPanel16Layout);
                                                jPanel16Layout.setHorizontalGroup(
                                                    jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel16Layout.createSequentialGroup()
                                                        .addGap(23, 23, 23)
                                                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jbtn_imagenfull3)
                                                        .addContainerGap(15, Short.MAX_VALUE))
                                                );
                                                jPanel16Layout.setVerticalGroup(
                                                    jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel16Layout.createSequentialGroup()
                                                        .addGap(11, 11, 11)
                                                        .addComponent(jbtn_imagenfull3))
                                                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                );

                                                jPanel18.setName("jPanel18"); // NOI18N

                                                jScrollPane6.setName("jScrollPane6"); // NOI18N

                                                jtbl_ventayexis.setFont(resourceMap.getFont("jtbl_ventayexis.font")); // NOI18N
                                                jtbl_ventayexis.setModel(this.jtable_modelo_ventayexistencia);
                                                jtbl_ventayexis.setName("jtbl_ventayexis"); // NOI18N
                                                jtbl_ventayexis.setRowHeight(22);
                                                jtbl_ventayexis.setSelectionBackground(resourceMap.getColor("jtbl_ventayexis.selectionBackground")); // NOI18N
                                                jtbl_ventayexis.setSelectionForeground(resourceMap.getColor("jtbl_ventayexis.selectionForeground")); // NOI18N
                                                jtbl_ventayexis.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtbl_ventayexisMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickfotovye(evt);
                                                            //System.out.println(" double click" );

                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickav(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane6.setViewportView(jtbl_ventayexis);

                                                javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
                                                jPanel18.setLayout(jPanel18Layout);
                                                jPanel18Layout.setHorizontalGroup(
                                                    jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1017, Short.MAX_VALUE)
                                                );
                                                jPanel18Layout.setVerticalGroup(
                                                    jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel18Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                                                );

                                                jtf_fotoidveyex.setFont(resourceMap.getFont("jtf_fotoidveyex.font")); // NOI18N
                                                jtf_fotoidveyex.setName("jtf_fotoidveyex"); // NOI18N

                                                javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
                                                jPanel11.setLayout(jPanel11Layout);
                                                jPanel11Layout.setHorizontalGroup(
                                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                                .addContainerGap()
                                                                .addComponent(jLabel6)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 4, Short.MAX_VALUE))
                                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                                .addContainerGap()
                                                                .addComponent(jtf_fotoidveyex, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(292, 292, 292))
                                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                                        .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );
                                                jPanel11Layout.setVerticalGroup(
                                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                                .addComponent(jtf_fotoidveyex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(57, 57, 57)
                                                                .addComponent(jLabel6))
                                                            .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(58, 58, 58))
                                                );

                                                javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                                                jPanel10.setLayout(jPanel10Layout);
                                                jPanel10Layout.setHorizontalGroup(
                                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );
                                                jPanel10Layout.setVerticalGroup(
                                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addContainerGap())
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel10.TabConstraints.tabTitle"), jPanel10); // NOI18N

                                                jPanel12.setName("jPanel12"); // NOI18N

                                                jScrollPane7.setName("jScrollPane7"); // NOI18N

                                                jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
                                                jepn_fotos.setName("jepn_fotos"); // NOI18N
                                                jScrollPane7.setViewportView(jepn_fotos);

                                                jtf_fotosartxpag.setText(resourceMap.getString("jtf_fotosartxpag.text")); // NOI18N
                                                jtf_fotosartxpag.setToolTipText(resourceMap.getString("jtf_fotosartxpag.toolTipText")); // NOI18N
                                                jtf_fotosartxpag.setName("jtf_fotosartxpag"); // NOI18N
                                                jtf_fotosartxpag.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_fotosartxpagActionPerformed(evt);
                                                    }
                                                });

                                                jlbl_paginas.setText(resourceMap.getString("jlbl_paginas.text")); // NOI18N
                                                jlbl_paginas.setName("jlbl_paginas"); // NOI18N

                                                jbtn_anterior.setIcon(resourceMap.getIcon("jbtn_anterior.icon")); // NOI18N
                                                jbtn_anterior.setText(resourceMap.getString("jbtn_anterior.text")); // NOI18N
                                                jbtn_anterior.setName("jbtn_anterior"); // NOI18N
                                                jbtn_anterior.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_anteriorActionPerformed(evt);
                                                    }
                                                });

                                                jtf_paginaactual.setText(resourceMap.getString("jtf_paginaactual.text")); // NOI18N
                                                jtf_paginaactual.setName("jtf_paginaactual"); // NOI18N
                                                jtf_paginaactual.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_paginaactualActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_siguiente.setIcon(resourceMap.getIcon("jbtn_siguiente.icon")); // NOI18N
                                                jbtn_siguiente.setText(resourceMap.getString("jbtn_siguiente.text")); // NOI18N
                                                jbtn_siguiente.setName("jbtn_siguiente"); // NOI18N
                                                jbtn_siguiente.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_siguienteActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
                                                jPanel12.setLayout(jPanel12Layout);
                                                jPanel12Layout.setHorizontalGroup(
                                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(50, 50, 50)
                                                        .addComponent(jlbl_paginas)
                                                        .addGap(27, 27, 27)
                                                        .addComponent(jbtn_anterior)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jbtn_siguiente)
                                                        .addContainerGap(600, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1027, Short.MAX_VALUE)
                                                );
                                                jPanel12Layout.setVerticalGroup(
                                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jlbl_paginas)
                                                            .addComponent(jbtn_anterior)
                                                            .addComponent(jbtn_siguiente)
                                                            .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel12.TabConstraints.tabTitle"), jPanel12); // NOI18N

                                                jPanel22.setName("jPanel22"); // NOI18N

                                                jPanel23.setName("jPanel23"); // NOI18N

                                                jScrollPane9.setName("jScrollPane9"); // NOI18N

                                                jtbl_recepciones.setModel(this.jtable_modelo_rec);
                                                jtbl_recepciones.setName("jtbl_recepciones"); // NOI18N
                                                jtbl_recepciones.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtbl_recepcionesMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickr(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane9.setViewportView(jtbl_recepciones);

                                                jScrollPane10.setName("jScrollPane10"); // NOI18N

                                                jlst_clientesdistribucion.setModel(this.modelo);
                                                jlst_clientesdistribucion.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
                                                jlst_clientesdistribucion.setName("jlst_clientesdistribucion"); // NOI18N
                                                jlst_clientesdistribucion.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jlst_clientesdistribucionMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclicklis(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane10.setViewportView(jlst_clientesdistribucion);

                                                javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
                                                jPanel23.setLayout(jPanel23Layout);
                                                jPanel23Layout.setHorizontalGroup(
                                                    jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel23Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE))
                                                );
                                                jPanel23Layout.setVerticalGroup(
                                                    jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel23Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE))
                                                    .addGroup(jPanel23Layout.createSequentialGroup()
                                                        .addGap(31, 31, 31)
                                                        .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE))
                                                );

                                                jtf_clientedetalle.setText(resourceMap.getString("jtf_clientedetalle.text")); // NOI18N
                                                jtf_clientedetalle.setName("jtf_clientedetalle"); // NOI18N

                                                jbtn_imprimirdetalle.setIcon(resourceMap.getIcon("jbtn_imprimirdetalle.icon")); // NOI18N
                                                jbtn_imprimirdetalle.setText(resourceMap.getString("jbtn_imprimirdetalle.text")); // NOI18N
                                                jbtn_imprimirdetalle.setName("jbtn_imprimirdetalle"); // NOI18N
                                                jbtn_imprimirdetalle.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imprimirdetalleActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
                                                jPanel22.setLayout(jPanel22Layout);
                                                jPanel22Layout.setHorizontalGroup(
                                                    jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel22Layout.createSequentialGroup()
                                                        .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel22Layout.createSequentialGroup()
                                                                .addGap(10, 10, 10)
                                                                .addComponent(jtf_clientedetalle, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(29, 29, 29)
                                                                .addComponent(jbtn_imprimirdetalle, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );
                                                jPanel22Layout.setVerticalGroup(
                                                    jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel22Layout.createSequentialGroup()
                                                        .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18, 18, 18)
                                                        .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jtf_clientedetalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_imprimirdetalle))
                                                        .addContainerGap(233, Short.MAX_VALUE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel22.TabConstraints.tabTitle"), jPanel22); // NOI18N

                                                jPanel24.setName("jPanel24"); // NOI18N

                                                jPanel25.setName("jPanel25"); // NOI18N

                                                jScrollPane2.setName("jScrollPane2"); // NOI18N

                                                jtb_catalogo_articulos1.setModel(this.jtable_modelo_sie);
                                                jtb_catalogo_articulos1.setName("jtb_catalogo_articulos1"); // NOI18N
                                                jtb_catalogo_articulos1.setRowHeight(26);
                                                jtb_catalogo_articulos1.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_catalogo_articulos1MouseClicked(evt);
                                                    }
                                                });
                                                jtb_catalogo_articulos1.addKeyListener(new java.awt.event.KeyAdapter() {
                                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                                        jtb_catalogo_articulos1KeyPressed(evt);
                                                    }
                                                });
                                                jScrollPane2.setViewportView(jtb_catalogo_articulos1);

                                                javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
                                                jPanel25.setLayout(jPanel25Layout);
                                                jPanel25Layout.setHorizontalGroup(
                                                    jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGap(0, 1027, Short.MAX_VALUE)
                                                    .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1027, Short.MAX_VALUE))
                                                );
                                                jPanel25Layout.setVerticalGroup(
                                                    jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGap(0, 528, Short.MAX_VALUE)
                                                    .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel25Layout.createSequentialGroup()
                                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE)
                                                            .addContainerGap()))
                                                );

                                                jbtn_viajeimprimir.setText(resourceMap.getString("jbtn_viajeimprimir.text")); // NOI18N
                                                jbtn_viajeimprimir.setName("jbtn_viajeimprimir"); // NOI18N
                                                jbtn_viajeimprimir.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_viajeimprimirActionPerformed(evt);
                                                    }
                                                });

                                                jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                                jLabel8.setName("jLabel8"); // NOI18N

                                                jtf_idarticulos.setEditable(false);
                                                jtf_idarticulos.setText(resourceMap.getString("jtf_idarticulos.text")); // NOI18N
                                                jtf_idarticulos.setName("jtf_idarticulos"); // NOI18N

                                                javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
                                                jPanel24.setLayout(jPanel24Layout);
                                                jPanel24Layout.setHorizontalGroup(
                                                    jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addGroup(jPanel24Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jLabel8)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jtf_idarticulos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(669, 669, 669)
                                                        .addComponent(jbtn_viajeimprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(59, Short.MAX_VALUE))
                                                );
                                                jPanel24Layout.setVerticalGroup(
                                                    jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel24Layout.createSequentialGroup()
                                                        .addComponent(jPanel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jbtn_viajeimprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel8)
                                                            .addComponent(jtf_idarticulos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addContainerGap(23, Short.MAX_VALUE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel24.TabConstraints.tabTitle"), jPanel24); // NOI18N

                                                jMenuBar1.setName("jMenuBar1"); // NOI18N

                                                jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                                jMenu1.setName("jMenu1"); // NOI18N

                                                jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
                                                jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                                jmni_salir.setName("jmni_salir"); // NOI18N
                                                jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_salirActionPerformed(evt);
                                                    }
                                                });
                                                jMenu1.add(jmni_salir);

                                                jMenuBar1.add(jMenu1);

                                                jmni_resumenprov.setText(resourceMap.getString("jmni_resumenprov.text")); // NOI18N
                                                jmni_resumenprov.setName("jmni_resumenprov"); // NOI18N
                                                jmni_resumenprov.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_resumenprovActionPerformed(evt);
                                                    }
                                                });

                                                jmni_guardar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F7, 0));
                                                jmni_guardar.setText(resourceMap.getString("jmni_guardar.text")); // NOI18N
                                                jmni_guardar.setName("jmni_guardar"); // NOI18N
                                                jmni_guardar.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_guardarActionPerformed(evt);
                                                    }
                                                });
                                                jmni_resumenprov.add(jmni_guardar);

                                                jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                                jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                                jmni_escape.setName("jmni_escape"); // NOI18N
                                                jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_escapeActionPerformed(evt);
                                                    }
                                                });
                                                jmni_resumenprov.add(jmni_escape);

                                                jmni_imprimirdistri.setText(resourceMap.getString("jmni_imprimirdistri.text")); // NOI18N
                                                jmni_imprimirdistri.setName("jmni_imprimirdistri"); // NOI18N
                                                jmni_imprimirdistri.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_imprimirdistriActionPerformed(evt);
                                                    }
                                                });
                                                jmni_resumenprov.add(jmni_imprimirdistri);

                                                jmni_printresumen.setText(resourceMap.getString("jmni_printresumen.text")); // NOI18N
                                                jmni_printresumen.setName("jmni_printresumen"); // NOI18N
                                                jmni_printresumen.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_printresumenActionPerformed(evt);
                                                    }
                                                });
                                                jmni_resumenprov.add(jmni_printresumen);

                                                jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
                                                jMenuItem1.setName("jMenuItem1"); // NOI18N
                                                jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jMenuItem1ActionPerformed(evt);
                                                    }
                                                });
                                                jmni_resumenprov.add(jMenuItem1);

                                                jMenuBar1.add(jmni_resumenprov);

                                                setJMenuBar(jMenuBar1);

                                                javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                                getContentPane().setLayout(layout);
                                                layout.setHorizontalGroup(
                                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1032, Short.MAX_VALUE)
                                                );
                                                layout.setVerticalGroup(
                                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 613, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                pack();
                                            }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
                {
                    this.dispose();
                }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        indexactual = this.jTabbedPane1.getSelectedIndex();
        if (((indexactual == 1)||(indexactual == 4)||(indexactual == 5)||(indexactual == 6)||(indexactual == 8)) && (yacargueestadistica == 0)) {
            yacargueestadistica = 1;
            this.cargar_datos(this.jtf_idviaje.getText());
            this.carga_datos_fotospaginacion(0);
         }
        if ((indexactual == 2) && (yacargueviajedistri == 0)) {
            yacargueviajedistri = 1;
               this.carga_datos_distribucionalma(4,this.jtf_idviaje.getText());
               this.carga_datos_distribucionalma_tot(6,this.jtf_idviaje.getText());

            }
        if ((indexactual == 3) && (yacarguefamrot == 0)) {
            if(JOptionPane.showConfirmDialog(null, "<html><h2>Este Reporte puede tardar unos minutos<br> Desea verlo?</h2></html>")==0)
                    {
                        yacarguefamrot = 1;
                        this.carga_datos_compras_xfamilia(this.jtf_idviaje.getText());
                    }
            }
        if ((indexactual == 4) && (yacargueexitie == 0))
            {
                    yacargueexitie = 1;
                    this.verexistencias();
                    this.centrar_datos();
            }
        if ((indexactual == 5) && (yacarguevenacum == 0))
            {
                    yacarguevenacum = 1;
                    this.verexisyacumventas();
                    this.centrar_datos();
            }

    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jchk_graficadistribucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchk_graficadistribucionActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_distribuciontotal();
}//GEN-LAST:event_jchk_graficadistribucionActionPerformed

    private void jrbtn_columnaclave1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_columnaclave1ActionPerformed

    private void jrbtn_item1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_item1ActionPerformed

    private void jtf_buscarenjtableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtableActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable(columnavisualisa, 0, this.jtf_buscarenjtable.getText().toUpperCase().trim());
}//GEN-LAST:event_jtf_buscarenjtableActionPerformed

    private void jchxb_verdetallefamrotacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchxb_verdetallefamrotacionActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea ver Detalle?")==0) {
            this.carga_datos_compras_xfam_detpro(6, this.jtf_idviaje.getText(),"");
        }
    }//GEN-LAST:event_jchxb_verdetallefamrotacionActionPerformed

    private void jchxb_verdetallefamrotacion1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchxb_verdetallefamrotacion1ActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea ver Detalle?")==0) {
            this.carga_datos_compras_xfam_detpro_arti(9, this.jtf_idviaje.getText(),"","");
         }
    }//GEN-LAST:event_jchxb_verdetallefamrotacion1ActionPerformed

    private void jtf_viajedescribeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_viajedescribeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_viajedescribeActionPerformed

    private void jdc_fechainicioKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechainicioKeyPressed
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechainicioKeyPressed

    private void jdc_fechafinKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechafinKeyPressed
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechafinKeyPressed

    private void jtf_observacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_observacionesActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_observacionesActionPerformed

    private void jtf_pedimentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_pedimentoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_pedimentoActionPerformed

    private void jbtn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Estan Correctos los Datos?")==0)
        {
         int folio=0;
         String textosql="select * from x1distribucion_terminados_viajes_actualiza(1,'"+this.jtf_idviaje.getText()+"','"+this.jtf_viajedescribe.getText().toUpperCase().trim()+"','"+this.fechaamericana(this.jdc_fechainicio.getDate())+"','"+this.fechaamericana(this.jdc_fechafin.getDate())+"','"+this.jtf_observaciones.getText().toUpperCase().trim()+"','"+this.jtf_pedimento.getText().toUpperCase().trim()+"');";
         try {
            rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
            while (rs.next())
                {
                folio = rs.getInt(1);
                if (folio==1)
                      {
                        JOptionPane.showMessageDialog(null,"Gracias Datos Actualizados", "Sistema Integral: Viajes",1);
                      }
                else
                      {
                        JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
                      }
                }
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
        }

    }//GEN-LAST:event_jbtn_guardarActionPerformed

    private void jmni_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_guardarActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
    }//GEN-LAST:event_jmni_guardarActionPerformed

    private void jtf_fotosartxpagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpagActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_fotosartxpagActionPerformed

    private void jbtn_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anteriorActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jbtn_anteriorActionPerformed

    private void jtf_paginaactualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactualActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_paginaactualActionPerformed

    private void jbtn_siguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguienteActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));

    }//GEN-LAST:event_jbtn_siguienteActionPerformed

    private void jbtn_imagenfullActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfullActionPerformed
        // TODO add your handling code here:


        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_fotoiddetar.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
}//GEN-LAST:event_jbtn_imagenfullActionPerformed

    private void jbtn_imagenfull1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfull1ActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_fotoiddistri.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
    }//GEN-LAST:event_jbtn_imagenfull1ActionPerformed

    private void jbtn_imagenfull2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfull2ActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_fotoidexitie.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
    }//GEN-LAST:event_jbtn_imagenfull2ActionPerformed

    private void jbtn_imagenfull3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfull3ActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_fotoidveyex.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
    }//GEN-LAST:event_jbtn_imagenfull3ActionPerformed

    private void jmni_resumenprovActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_resumenprovActionPerformed
   
}//GEN-LAST:event_jmni_resumenprovActionPerformed

    private void jmni_imprimirdistriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_imprimirdistriActionPerformed
        // TODO add your handling code here:
          try {
            // TODO add your handling code here:
            this.jtbl_distribucion.print();
        } catch (PrinterException ex) {
            Logger.getLogger(com_distri_clasif_viajes_detalle.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_jmni_imprimirdistriActionPerformed

    private void jbtn_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_busquedaActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan correcto sus Datos?")==0) {
          
           this.carga_datos_distribucionalma(5,this.jtf_idfolio.getText());
        }
}//GEN-LAST:event_jbtn_busquedaActionPerformed

    private void jmni_printresumenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_printresumenActionPerformed
        // TODO add your handling code here:
        //this.imprimir(0, 1,"0");
//                try {
            // TODO add your handling code here:
//            this.jtbl_distribucion1.print();
//        } catch (PrinterException ex) {
//            Logger.getLogger(com_distri_clasif_viajes_detalle.class.getName()).log(Level.SEVERE, null, ex);
//        }

    }//GEN-LAST:event_jmni_printresumenActionPerformed

    private void jtf_idfolioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_idfolioActionPerformed
        // TODO add your handling code here:
        this.jbtn_busquedaActionPerformed(evt);
    }//GEN-LAST:event_jtf_idfolioActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
     try {
            this.jtb_comprascatalogo.print();
        } catch (PrinterException ex) {
            Logger.getLogger(com_distri_clasif_viajes_detalle.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jbtn_imprimirdetalleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imprimirdetalleActionPerformed
        // TODO add your handling code here:
if(JOptionPane.showConfirmDialog(null, "Desea Imprimir resumen de la tienda:"+this.jtf_clientedetalle.getText()+"?")==0)
        {
            this.imprimir_detalle(0, 1,"0");
        }
    }//GEN-LAST:event_jbtn_imprimirdetalleActionPerformed

    private void jbtn_viajecerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_viajecerrarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos los Datos?")==0)
        {
         int folio=0;
         String textosql="select * from x1distribucion_terminados_viajes_actualiza(5,'"+this.jtf_idviaje.getText()+"','"+this.jtf_viajedescribe.getText().toUpperCase().trim()+"','"+this.fechaamericana(this.jdc_fechainicio.getDate())+"','"+this.fechaamericana(this.jdc_fechafin.getDate())+"','"+this.jtf_observaciones.getText().toUpperCase().trim()+"','"+this.jtf_pedimento.getText().toUpperCase().trim()+"');";
         try {
            rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
            while (rs.next())
                {
                folio = rs.getInt(1);
                if (folio==1)
                      {
                        JOptionPane.showMessageDialog(null,"Gracias Datos Actualizados", "Sistema Integral: Viajes",1);
                      }
                else
                      {
                        JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
                      }
                }
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
        }
}//GEN-LAST:event_jbtn_viajecerrarActionPerformed

    private void jtb_catalogo_articulos1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtb_catalogo_articulos1MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jtb_catalogo_articulos1MouseClicked

    private void jtb_catalogo_articulos1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtb_catalogo_articulos1KeyPressed
        // TODO add your handling code here:
        //control enter se utiliza por un rollo de que al dar enter se mostraban dos veces  el documento
        System.out.println(evt.getKeyCode());
        if (evt.getKeyCode() == 10) {
            if (control_enter > 1) {
                try {
                    //si entra al if inicializo la variable para evitar qu al regreso entre una vez mas
                    control_enter=0;
                    System.out.println(control_enter);
                    int fila = jtb_catalogo_articulos.getSelectedRow();
                    Object valor = jtb_catalogo_articulos.getValueAt(fila, 3);
                    //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
                    articulos_sie_editar fase=new articulos_sie_editar(valor.toString());
                    fase.setVisible(true);
                } catch (Exception ex) {
                    System.out.println("ERROR no ha elegido en el cuadro de texto");
                }
            }
        }
        control_enter+=1;
}//GEN-LAST:event_jtb_catalogo_articulos1KeyPressed

    private void jbtn_viajeimprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_viajeimprimirActionPerformed
        // TODO add your handling code here:
              float filas = this.jtable_modelo_sie.getRowCount() ;
        float paginas = filas /50;
        int ni=0;
        for(ni=0;ni<paginas;ni++)
             {
                 this.imprimir_articulosviaje(ni, paginas);
             }
    }//GEN-LAST:event_jbtn_viajeimprimirActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Generar Archivo esto Puede Tardar unos Minutos?")==0) {
                    this.exportar_archivocompleto();
          }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:



        //this.jtfpruebados.setText(jtable_tiendas.getValueAt(indeceta, 0).toString());
}//GEN-LAST:event_jcbx_tiendasActionPerformed

    private void jbtn_generareporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generareporteActionPerformed
        // TODO add your handling code here:
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(this.jdc_fechainicial.getDate());//fecha final de reporte
        String pFecha = formato.format(this.jdc_fechafinal.getDate());//fecha final de reporte
        String idcli[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            this.carga_datos_compras_xtienda(11,idcli[2] ,this.jtf_idviaje.getText(),idcli[0],pFechai,pFecha);
        }
}//GEN-LAST:event_jbtn_generareporteActionPerformed

    private void jdc_fechainicialInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jdc_fechainicialInputMethodTextChanged
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechainicialInputMethodTextChanged

    private void jdc_fechainicialKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechainicialKeyPressed
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechainicialKeyPressed
        private void jtbl_recepcionesMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jlst_clientesdistribucionMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtbl_ventayexisMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtbl_existenciaentieMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
        int columna = jtb_catalogo_articulos.getSelectedColumn();
        int folio = 0;
        int fila = jtb_catalogo_articulos.getSelectedRow();
        String idcadena=this.jtb_catalogo_articulos.getValueAt(fila, 5).toString();


        com_distri_articulos_almacen_detalle fcdaad=new com_distri_articulos_almacen_detalle(1,idcadena);
        fcdaad.pack();
        fcdaad.setVisible(true);

    //setVisible(false);
    }
 private void dioclic(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");

        int fila = jtb_comprascatalogo.getSelectedRow();
        String idfolio = jtb_comprascatalogo.getValueAt(fila, 1).toString();

        com_distri_compras_detalle fcdcd=new com_distri_compras_detalle(idfolio);
        fcdcd.pack();
        fcdcd.setVisible(true);
    }
private void dioclickfamdet(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");

         int fila = jtb_comxfamilias.getSelectedRow();
         if(JOptionPane.showConfirmDialog(null, "Desea ver Detalle de la Familia, esto tardara unos minutos?")==0)
            {
                     String idfamilia[] = jtb_comxfamilias.getValueAt(fila, 0).toString().split(":");
                    this.carga_datos_compras_xfam_detpro(7, this.jtf_idviaje.getText(), idfamilia[0]);
            }

    }
private void dioclickr(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        int fila = jtbl_recepciones.getSelectedRow();
        Object valor = jtbl_recepciones.getValueAt(fila, 0);
        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        com_distri_folios_detalle fdd=new com_distri_folios_detalle(String.valueOf(valor));
        fdd.pack();
        fdd.setVisible(true);
    }
private void dioclickfamdet_artis(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click para ver detalle de este proveedor");
         int fila = jtb_comxfam_detalleprov.getSelectedRow();
         String idpro[] = jtb_comxfam_detalleprov.getValueAt(fila, 1).toString().split(":");
         String idfam[] = jtb_comxfam_detalleprov.getValueAt(fila, 0).toString().split(":");
         this.carga_datos_compras_xfam_detpro_arti(8, this.jtf_idviaje.getText(),idfam[0],idpro[0]);
    }

private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
 private void jtb_comxfam_detalleprovMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

 
   
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new com_distri_clasif_viajes_detalle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_anterior;
    private javax.swing.JButton jbtn_busqueda;
    private javax.swing.JButton jbtn_generareporte;
    private javax.swing.JButton jbtn_guardar;
    private javax.swing.JButton jbtn_imagenfull;
    private javax.swing.JButton jbtn_imagenfull1;
    private javax.swing.JButton jbtn_imagenfull2;
    private javax.swing.JButton jbtn_imagenfull3;
    private javax.swing.JButton jbtn_imprimirdetalle;
    private javax.swing.JButton jbtn_siguiente;
    private javax.swing.JButton jbtn_viajecerrar;
    private javax.swing.JButton jbtn_viajeimprimir;
    private javax.swing.JComboBox jcbx_tiendas;
    private javax.swing.JCheckBox jchk_graficadistribucion;
    private javax.swing.JCheckBox jchxb_verdetallefamrotacion;
    private javax.swing.JCheckBox jchxb_verdetallefamrotacion1;
    private com.toedter.calendar.JDateChooser jdc_fechafin;
    private com.toedter.calendar.JDateChooser jdc_fechafinal;
    private com.toedter.calendar.JDateChooser jdc_fechainicial;
    private com.toedter.calendar.JDateChooser jdc_fechainicio;
    private javax.swing.JEditorPane jep_articuloimagen;
    private javax.swing.JEditorPane jep_articuloimagen1;
    private javax.swing.JEditorPane jep_articuloimagen2;
    private javax.swing.JEditorPane jep_articuloimagen3;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlb_resultado;
    private javax.swing.JLabel jlbl_diafin;
    private javax.swing.JLabel jlbl_diaini;
    private javax.swing.JLabel jlbl_paginas;
    private javax.swing.JList jlst_clientesdistribucion;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_guardar;
    private javax.swing.JMenuItem jmni_imprimirdistri;
    private javax.swing.JMenuItem jmni_printresumen;
    private javax.swing.JMenu jmni_resumenprov;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_columnaclave1;
    private javax.swing.JRadioButton jrbtn_item1;
    private javax.swing.JTable jtb_catalogo_articulos;
    private javax.swing.JTable jtb_catalogo_articulos1;
    private javax.swing.JTable jtb_comprascatalogo;
    private javax.swing.JTable jtb_comxfam_detalleprov;
    private javax.swing.JTable jtb_comxfam_detalleprov_artis;
    private javax.swing.JTable jtb_comxfamilias;
    private javax.swing.JTable jtbl_distribucion;
    private javax.swing.JTable jtbl_distribucion1;
    private javax.swing.JTable jtbl_existenciaentie;
    private javax.swing.JTable jtbl_recepciones;
    private javax.swing.JTable jtbl_ventayexis;
    private javax.swing.JTextField jtf_buscarenjtable;
    private javax.swing.JTextField jtf_clientedetalle;
    private javax.swing.JTextField jtf_fotoiddetar;
    private javax.swing.JTextField jtf_fotoiddistri;
    private javax.swing.JTextField jtf_fotoidexitie;
    private javax.swing.JTextField jtf_fotoidveyex;
    private javax.swing.JTextField jtf_fotosartxpag;
    private javax.swing.JTextField jtf_idarticulos;
    private javax.swing.JTextField jtf_idfolio;
    private javax.swing.JTextField jtf_idviaje;
    private javax.swing.JTextField jtf_idviajestatus;
    private javax.swing.JTextField jtf_observaciones;
    private javax.swing.JTextField jtf_paginaactual;
    private javax.swing.JTextField jtf_pedimento;
    private javax.swing.JTextField jtf_totaldistribucion;
    private javax.swing.JTextField jtf_viajedescribe;
    // End of variables declaration//GEN-END:variables
private com_distri_folios_imprimir objimpresora;
private com_distri_articulos_almacen_imprimir objimpresora2;
}
